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

Function cbm_sqlite_realloc

internal/cbm/cbm.c:770–782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

768 mi_free(p);
769}
770static void *cbm_sqlite_realloc(void *p, int n) {
771 size_t old_size = p ? mi_usable_size(p) : 0;
772 mi_heap_t *heap = sqlite_heap();
773 CBM_MEMEV_BACKING(1);
774 void *grown = heap ? mi_heap_realloc(heap, p, (size_t)n) : mi_realloc(p, (size_t)n);
775 CBM_MEMEV_BACKING(-1);
776 if (grown) {
777 cbm_mem_class_remove_external(CBM_MEM_CLASS_STORE, old_size);
778 cbm_mem_class_add_external(CBM_MEM_CLASS_STORE, mi_usable_size(grown));
779 }
780 BOUND_REALLOC(p, grown, (size_t)n);
781 return grown;
782}
783static int cbm_sqlite_size(void *p) {
784 return (int)mi_usable_size(p);
785}

Callers

nothing calls this directly

Calls 3

sqlite_heapFunction · 0.85

Tested by

no test coverage detected