| 111 | } |
| 112 | |
| 113 | static 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 | |
| 133 | static char *acl_debug_strndup(const char *filename, int line, const char *str, size_t size) |
| 134 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…