Changed hashmap internals slightly, implemented dynamic hashmap growing

This commit is contained in:
cannoli-fruit 2026-07-11 17:46:46 -04:00
commit 611f5d5b5a
3 changed files with 77 additions and 45 deletions

15
examples/hm_fill.c Normal file
View file

@ -0,0 +1,15 @@
#include <stdio.h>
#define LAZY_IMPL
#include "../lazy.h"
int main() {
Lz_HM(size_t,size_t) hm;
lz_hm_init(hm);
for (size_t i = 0; i < 384; ++i) {
lz_hm_add(hm, i, 2*i);
}
for (size_t i = 0; i < 384; ++i) {
printf("hm[%zu] = %zu\n", i, lz_hm_get(hm,i));
}
}