hashtable icon indicating copy to clipboard operation
hashtable copied to clipboard

A pure C hashtable implementation.

Results 4 hashtable issues
Sort by recently updated
recently updated
newest added

double y = 290; ht_insert(&table, "HELL", &y); double* k = (double*)ht_lookup(&table, "HELLO"); if (k) printf("[%s]'s value is: [%f]\n", "HELLO", *k); else printf("[%s] NOT FOUND!\n", "HELLO"); ===================== [HELLO]'s value is: [290.000000]

1. Are ht_contains(..) and ht_lookup(..) thread-safe where they can be called in the child threads simultaneously? 2. What's the difference between ht_setup(...) and ht_reserve(...)? Is ht_reserve an optional function?

"... hashtable is a feature-complete, generic and customizable separate-chaining hashtable in pure C...." How do we iterate through this hash table?

`HT_SHRINK_THRESHOLD` is defined as `(1/4)`, which is 0 (because of int division). This means that `_ht_should_shrink` will return true if and only if the size (`table->size`) is 0. This doesn't...