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

Function is_alloc_name

internal/cbm/cbm.c:1081–1086  ·  view source on GitHub ↗

Allocation / growable-append calls: repeated inside a loop is the classic accidental reallocation / string-concat O(n^2). Names are deliberately conservative; meaningless in some languages → simply never matches there.

Source from the content-addressed store, hash-verified

1079// accidental reallocation / string-concat O(n^2). Names are deliberately
1080// conservative; meaningless in some languages → simply never matches there.
1081static bool is_alloc_name(const char *n) {
1082 static const char *const set[] = {"malloc", "calloc", "realloc", "strdup", "strndup",
1083 "append", "push_back", "emplace_back", "concat", "strcat",
1084 "strncat", "push", "pushback", NULL};
1085 return name_in_set(n, set);
1086}
1087
1088// Extract the receiver identifier from a def's receiver text — Go's
1089// "(s *Store)" / "(s Store)" → "s". Stores the identifier start in *out and

Callers 1

extract_file_ex_bodyFunction · 0.85

Calls 1

name_in_setFunction · 0.85

Tested by

no test coverage detected