This commit is contained in:
2024-06-20 05:36:42 +02:00
parent f530a13481
commit 242b501404
6 changed files with 85 additions and 26 deletions

View File

@@ -191,7 +191,6 @@ int tt_create(s32 sizemb)
if (sizemb <= 0)
sizemb = HASH_SIZE_DEFAULT;
sizemb = clamp(sizemb, HASH_SIZE_MIN, HASH_SIZE_MAX);
//printf("-> %'6d ", sizemb);
bytes = sizemb * 1024ull * 1024ull; /* bytes wanted */
target_nbuckets = bytes / sizeof(bucket_t); /* target buckets */
@@ -199,7 +198,7 @@ int tt_create(s32 sizemb)
nbits = msb64(target_nbuckets); /* adjust to power of 2 */
if (hash_tt.nbits != nbits) {
if (hash_tt.nbits)
if (hash_tt.keys)
tt_delete();
hash_tt.nbits = nbits;