void * csm_malloc(int size);
Allocates shared memory and returns a pointer to it. When calculating the
necessary memory size for the application, please note that all memory
allocations are rounded up to the nearest page.
int csm_memory_page_round(int size);
- Rounds size to the nearest page.
void csm_distribute(void *addr, int size);
Distributes pointers into shared memory to other processes
(i.e., application instances). Pointers that reside in shared memory
should not be distributed since the underlying coherence mechanism will
ensure that they are up to date. Pointers that reside in private memory
space (e.g., the data segment or the stack)
(but point to shared memory objects) must be explicitly distributed since
they are not subject to the coherence mechanism. Thus function
must be called after csm_init_start and before csm_init_complete.
void csm_duplicate_writes(void *addr, int size);
- Not necessary when using polling.
- Distribute the shared memory object's data to other application processes
- Should only be used when automatic write-doubling has been disabled.