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

Function value_alloc

src/pipeline/doc_links_msbuild.c:706–726  ·  view source on GitHub ↗

Every property buffer is owned by a table entry. Account for the new and * old buffers simultaneously until copying has finished and the old one is * released; neither a replacement nor an unknown value retains history. */

Source from the content-addressed store, hash-verified

704 * old buffers simultaneously until copying has finished and the old one is
705 * released; neither a replacement nor an unknown value retains history. */
706static char *value_alloc(msb_eval_t *ev, size_t n) {
707 bool fail = n > SIZE_MAX - ev->value_bytes;
708#if defined(CBM_ENABLE_TEST_SEAMS) && CBM_ENABLE_TEST_SEAMS
709 fail = fail || msb_fail_value_alloc();
710#endif
711 if (fail) {
712 ev->oom = true;
713 return NULL;
714 }
715 char *p = (char *)cbm_alloc(CBM_MEM_CLASS_OTHER, n);
716 if (!p) {
717 ev->oom = true;
718 return NULL;
719 }
720 ev->value_bytes += n;
721#if defined(CBM_ENABLE_TEST_SEAMS) && CBM_ENABLE_TEST_SEAMS
722 atomic_fetch_add_explicit(&msb_value_live_counter, n, memory_order_relaxed);
723#endif
724 ev_peak(ev);
725 return p;
726}
727
728static void value_clear(msb_eval_t *ev, msb_prop_t *p) {
729 if (p->value) {

Callers 1

msb_setFunction · 0.85

Calls 3

msb_fail_value_allocFunction · 0.85
cbm_allocFunction · 0.85
ev_peakFunction · 0.85

Tested by

no test coverage detected