ROOT-Sim core
3.0.0-rc.2
A General-Purpose Multi-threaded Parallel/Distributed Simulation Library
|
Memory management functions for messages. More...
Go to the source code of this file.
Functions | |
void | msg_allocator_init (void) |
Initialize the message allocator thread-local data structures. | |
void | msg_allocator_fini (void) |
Finalize the message allocator thread-local data structures. | |
struct lp_msg * | msg_allocator_alloc (unsigned payload_size) |
Allocate a new message with given payload size. More... | |
void | msg_allocator_free (struct lp_msg *msg) |
Free a message. More... | |
void | msg_allocator_free_at_gvt (struct lp_msg *msg) |
Free a message after its destination time is committed. More... | |
void | msg_allocator_on_gvt (simtime_t current_gvt) |
Free the committed messages after a new GVT has been computed. More... | |
static struct lp_msg * | msg_allocator_pack (lp_id_t receiver, simtime_t timestamp, unsigned event_type, const void *payload, unsigned payload_size) |
Memory management functions for messages.
Memory management functions for messages
struct lp_msg* msg_allocator_alloc | ( | unsigned | payload_size | ) |
Allocate a new message with given payload size.
payload_size | the size in bytes of the requested message payload |
Since this module relies on the member lp_msg.pl_size (see msg_allocator_free()), it has writing responsibility on it.
void msg_allocator_free | ( | struct lp_msg * | msg | ) |
Free a message.
msg | a pointer to the message to release |
void msg_allocator_free_at_gvt | ( | struct lp_msg * | msg | ) |
Free a message after its destination time is committed.
msg | a pointer to the message to release |
void msg_allocator_on_gvt | ( | simtime_t | current_gvt | ) |
Free the committed messages after a new GVT has been computed.
current_gvt | the latest value of the GVT |