aboutsummaryrefslogtreecommitdiff
path: root/src/map.hff
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-14 11:16:03 +0200
committerlemon <lsof@mailbox.org>2022-08-14 11:16:03 +0200
commit0d1e125832d0fd8ca31c5f782e7c3db774ae5a02 (patch)
treee4622f75a8307d8ee1970f8bd6cc92766582f0ba /src/map.hff
parentc129f77ad724aa940b53a125de0e1e4de0ca7240 (diff)
woa
Diffstat (limited to 'src/map.hff')
-rw-r--r--src/map.hff5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/map.hff b/src/map.hff
index 87d0506..d7883dd 100644
--- a/src/map.hff
+++ b/src/map.hff
@@ -1,4 +1,5 @@
-import "all.hff";
+import "common.hff";
+import "util.hff";
// KTraits:
// :hash(K) u32
@@ -32,6 +33,8 @@ struct Map<K, V, KTraits> {
}
fn _reallockvb(self *Map) void {
+ // keys, vals, bitmap are in a contiguous memory allocation,
+ // XXX ^ alignment
let p = xcalloc((self.N * (sizeof K + sizeof V)) + (self.N / 8), 1);
self.keys = p;
self.vals = as(*V)(self.keys + self.N);