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

Function debug_htable_reset

lib_acl/src/stdlib/debug/debug_htable.c:293–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293int debug_htable_reset(DEBUG_HTABLE *table, void (*free_fn) (char *))
294{
295 if (table) {
296 unsigned i = table->size;
297 DEBUG_HTABLE_INFO *ht;
298 DEBUG_HTABLE_INFO *next;
299 DEBUG_HTABLE_INFO **h;
300 int ret;
301
302 h = table->data;
303
304 while (i-- > 0) {
305 for (ht = *h++; ht; ht = next) {
306 next = ht->next;
307 FREE(ht->key);
308 if (free_fn && ht->value)
309 (*free_fn) (ht->value);
310 FREE(ht);
311 }
312 }
313 FREE(table->data);
314 table->data = 0;
315
316 ret = debug_htable_size(table, table->init_size < 13 ? 13 : table->init_size);
317 return (ret);
318 }
319
320 return (-1);
321}
322
323/* debug_htable_walk - iterate over hash table */
324

Callers

nothing calls this directly

Calls 1

debug_htable_sizeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…