mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 03:05:31 -05:00
fix(core-logic): ensure store IDs fit in 5 bits
This commit is contained in:
parent
7d46a38e2c
commit
632d5e3f40
1 changed files with 2 additions and 1 deletions
|
|
@ -161,7 +161,8 @@ module Store = struct
|
||||||
let n = ref 0
|
let n = ref 0
|
||||||
|
|
||||||
let create ?(size = 256) () : t =
|
let create ?(size = 256) () : t =
|
||||||
let s_uid = !n in
|
(* store id, modulo 2^5 *)
|
||||||
|
let s_uid = !n land store_id_mask in
|
||||||
incr n;
|
incr n;
|
||||||
{ s_uid; s_exprs = Hcons.create ~size () }
|
{ s_uid; s_exprs = Hcons.create ~size () }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue