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 }}
Repository navigation
Commit 72350c3
Browse filesBrowse the repository at this point in the historyBrowse files
mem: HG_MALLOC - module arenas: memory a module asks for and HG manages
A module whose memory has nothing to do with transactions - a cache with
its own lifetime, class mix and growth - can now ask for an arena of its
own instead of carving chunks out of shm and managing them itself:
#include "mem/mem_arena.h"
mem_arena_t *a = shm_arena_create("cachedb_perf", init, cap); /* mod_init */
shm_arena_set_profile(a, "CACHE_PROFILE"); /* optional */
p = mem_arena_malloc(a, size); mem_arena_free(a, p);
The arena is an HG block like shm: slab classes with the per-process
caches, block GC and cross-class re-typing, elastic growth and shrink
within its own INIT:CAP, the maintenance process, its own hg_stats
section and lock histograms. It is created before the fork so every
child inherits the one shared mapping, independent of which allocator
-a selected for the core; the ownership registry routes a free to
whichever arena owns the pointer. The maintenance process now ticks
every registered shared elastic arena rather than the shm block alone,
hg_stats lists module arenas by name, and a process keeps cache state
for up to eight arenas. With no HG_MALLOC compiled in the facade returns
NULL and a module falls back to its own scheme.
0 commit comments