From 609980f9508af9b0b0eb89e868bd0f7edee84d2e Mon Sep 17 00:00:00 2001 From: dzaima Date: Wed, 29 Nov 2023 17:55:07 +0200 Subject: [PATCH] comment about HashMap entry format --- src/builtins/search.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builtins/search.c b/src/builtins/search.c index 81c97167..609f00d8 100644 --- a/src/builtins/search.c +++ b/src/builtins/search.c @@ -609,7 +609,7 @@ typedef struct HashMap { u64 pop; // count of defined entries u64 sh; // shift to turn hash into index u64 sz; // count of allocated entries, a power of 2 - u64 a[]; + u64 a[]; // lower 32 bits: index into keys/vals; upper 32 bits: upper 32 bits of hash } HashMap; static u64 hashmap_size(usz sh) { return ((u64)1 << (64-sh)) + 32; } static const u64 empty = ~(u64)0;