26 const void *payload,
unsigned payload_size)
35 memcpy(msg->
pl, payload, payload_size);
double simtime_t
Simulation time data type.
Definition: ROOT-Sim.h:27
uint64_t lp_id_t
Logical Process ID data type.
Definition: ROOT-Sim.h:33
#define likely(exp)
Optimize the branch as likely taken.
Definition: core.h:49
Message management functions.
struct lp_msg * msg_allocator_pack(lp_id_t receiver, simtime_t timestamp, unsigned event_type, const void *payload, unsigned payload_size)
Allocate a new message and populate it.
void msg_allocator_free_at_gvt(struct lp_msg *msg)
Free a message after its destination time is committed.
Definition: msg_allocator.c:81
void msg_allocator_free(struct lp_msg *msg)
Free a message.
Definition: msg_allocator.c:69
void msg_allocator_fini(void)
Finalize the message allocator thread-local data structures.
Definition: msg_allocator.c:32
struct lp_msg * msg_allocator_alloc(unsigned payload_size)
Allocate a new message with given payload size.
Definition: msg_allocator.c:51
void msg_allocator_on_gvt(simtime_t current_gvt)
Free the committed messages after a new GVT has been computed.
Definition: msg_allocator.c:90
void msg_allocator_init(void)
Initialize the message allocator thread-local data structures.
Definition: msg_allocator.c:23
A model simulation message.
Definition: msg.h:59
uint32_t m_type
The message type, a user controlled field.
Definition: msg.h:81
unsigned char pl[MSG_PAYLOAD_BASE_SIZE]
The initial part of the payload.
Definition: msg.h:85
simtime_t dest_t
The intended destination logical time of this message.
Definition: msg.h:65
lp_id_t dest
The id of the recipient LP.
Definition: msg.h:63