diff options
| author | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-22 17:28:26 +0100 |
|---|---|---|
| committer | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-22 17:28:26 +0100 |
| commit | cd38e101fcba293dbfe3ac9803bb9a7b673948fa (patch) | |
| tree | 9b2a65428d6a85c4fca61adc8d6f323a4d2ba280 /cm-demo.c | |
| parent | 543e8eb0075eb4bedb8bf08637416c2a5ebda50c (diff) | |
pass functions directly
Diffstat (limited to 'cm-demo.c')
| -rw-r--r-- | cm-demo.c | 13 |
1 files changed, 1 insertions, 12 deletions
@@ -4,16 +4,6 @@ #include "cheesemap.h" -void* cm_malloc(uintptr_t size, uint8_t* user) { - (void)user; - return malloc(size); -} - -void cm_free(void* ptr, uint8_t* user) { - (void)user; - free(ptr); -} - cm_hash_t cm_hash(const uint8_t* key, uint8_t* user) { (void)user; uint64_t k = *(const uint64_t*)key; @@ -32,8 +22,7 @@ bool cm_compare(const uint8_t* key1, const uint8_t* key2, uint8_t* user) { int main() { struct cheesemap map; - cm_new(&map, sizeof(uint64_t), sizeof(uint64_t), NULL, cm_malloc, cm_free, - NULL, cm_hash, cm_compare); + cm_new(&map, sizeof(uint64_t), sizeof(uint64_t), NULL, cm_hash, cm_compare); const uint64_t num_entries = 1000000; printf("Stress test: inserting %lu entries...\n", num_entries); |
