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

Function acl_debug_strdup

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

Source from the content-addressed store, hash-verified

111}
112
113static char *acl_debug_strdup(const char *filename, int line, const char *str)
114{
115 char key[256], *value;
116 size_t size = strlen(str);
117 char *ptr;
118
119 ASSERT(__debug_mem);
120
121 ptr = SANE_STRDUP(str);
122 ASSERT(ptr);
123 snprintf(key, sizeof(key), "0x%p", ptr);
124 value = (char*) malloc(DLEN);
125 ASSERT(value);
126 snprintf(value, DLEN, "%s%c%d%c%d", filename, SEP, line, SEP, (int) size);
127 LOCK;
128 ASSERT(debug_htable_enter(__debug_mem->table, key, value));
129 UNLOCK;
130 return (ptr);
131}
132
133static char *acl_debug_strndup(const char *filename, int line, const char *str, size_t size)
134{

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…