You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
kping0 edited this page Jun 26, 2018
·
2 revisions
Server Heap Allocation
Configuration
The server has the option to use protected heap allocation functions.
These functions (declared in "include/protected_malloc.h") are called sscs_cmalloc() and sscs_cfree(). However, to allow flexibility in configuration, they are defined as cmalloc() and cfree() (as seen here).
However, if a user does not want his server using protected allocation functions, he can comment out the SSCS_CUSTOM_MALLOC definition, which binds cmalloc() and cfree() to calloc() and free() (system specific).
NOTE: this results in a memory overhead per allocation of ~4-8 KB overhead (setting up a guardpage requires the memory to be aligned, meaning we have to allocate a multiple of the system pagesize) so allocating huge buffers is more effective, while allocating small buffers is VERY inefficient ( cmalloc(20) results in around 8KB being allocated )