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

Function acl_debug_calloc

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

Source from the content-addressed store, hash-verified

62}
63
64static void *acl_debug_calloc(const char *filename, int line, size_t nmemb, size_t size)
65{
66 char key[256], *value;
67 void *ptr;
68
69 ASSERT(__debug_mem);
70
71 ptr = calloc(nmemb, size);
72 ASSERT(ptr);
73 snprintf(key, sizeof(key), "0x%p", ptr);
74 value = (char*) malloc(DLEN);
75 ASSERT(value);
76 snprintf(value, DLEN, "%s%c%d%c%d", filename, SEP, line, SEP, (int) (nmemb * size));
77 LOCK;
78 ASSERT(debug_htable_enter(__debug_mem->table, key, value));
79 UNLOCK;
80 return (ptr);
81}
82
83static void *acl_debug_realloc(const char *filename, int line, void *old, size_t size)
84{

Callers

nothing calls this directly

Calls 3

callocFunction · 0.85
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…