MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_intern_create

Function cbm_intern_create

src/foundation/str_intern.c:46–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44};
45
46CBMInternPool *cbm_intern_create(void) {
47 CBMInternPool *p = (CBMInternPool *)calloc(CBM_ALLOC_ONE, sizeof(*p));
48 if (!p) {
49 return NULL;
50 }
51 cbm_arena_init(&p->arena);
52 p->capacity = CBM_SZ_256;
53 p->mask = p->capacity - SKIP_ONE;
54 p->buckets = (InternEntry *)calloc(p->capacity, sizeof(InternEntry));
55 if (!p->buckets) {
56 cbm_arena_destroy(&p->arena);
57 free(p);
58 return NULL;
59 }
60 return p;
61}
62
63void cbm_intern_free(CBMInternPool *pool) {
64 if (!pool) {

Callers 1

test_str_intern.cFile · 0.85

Calls 2

cbm_arena_initFunction · 0.70
cbm_arena_destroyFunction · 0.70

Tested by

no test coverage detected