MCPcopy Create free account
hub / github.com/acl-dev/acl / acl_debug_malloc

Function acl_debug_malloc

lib_acl/src/stdlib/debug/acl_debug_malloc.c:46–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44} while(0)
45
46static void *acl_debug_malloc(const char *filename, int line, size_t size)
47{
48 char key[256], *value;
49 void *ptr;
50
51 ASSERT(__debug_mem);
52
53 ptr = malloc(size);
54 ASSERT(ptr);
55 snprintf(key, sizeof(key), "0x%p", ptr);
56 value = (char*) malloc(DLEN);
57 snprintf(value, DLEN, "%s%c%d%c%d", filename, SEP, line, SEP, (int) size);
58 LOCK;
59 ASSERT(debug_htable_enter(__debug_mem->table, key, value));
60 UNLOCK;
61 return (ptr);
62}
63
64static void *acl_debug_calloc(const char *filename, int line, size_t nmemb, size_t size)
65{

Callers

nothing calls this directly

Calls 2

mallocFunction · 0.85
debug_htable_enterFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…