diff options
Diffstat (limited to 'erts/emulator/beam/erl_map.h')
-rw-r--r-- | erts/emulator/beam/erl_map.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/erts/emulator/beam/erl_map.h b/erts/emulator/beam/erl_map.h index 9f070ea33e..b451bad7e1 100644 --- a/erts/emulator/beam/erl_map.h +++ b/erts/emulator/beam/erl_map.h @@ -55,14 +55,18 @@ typedef struct flatmap_s { /* the head-node is a bitmap or array with an untagged size */ - #define hashmap_size(x) (((hashmap_head_t*) hashmap_val(x))->size) -#define hashmap_make_hash(Key) make_internal_hash(Key, 0) +#define hashmap_make_hash(Key) make_map_hash(Key, 0) + +#define hashmap_restore_hash(Lvl, Key) \ + (((Lvl) < 8) ? \ + hashmap_make_hash(Key) >> (4*(Lvl)) : \ + make_map_hash(Key, ((Lvl) >> 3)) >> (4 * ((Lvl) & 7))) -#define hashmap_restore_hash(Heap,Lvl,Key) \ - (((Lvl) < 8) ? hashmap_make_hash(Key) >> (4*(Lvl)) : hashmap_make_hash(CONS(Heap, make_small((Lvl)>>3), (Key))) >> (4*((Lvl) & 7))) -#define hashmap_shift_hash(Heap,Hx,Lvl,Key) \ - (((++(Lvl)) & 7) ? (Hx) >> 4 : hashmap_make_hash(CONS(Heap, make_small((Lvl)>>3), Key))) +#define hashmap_shift_hash(Hx, Lvl, Key) \ + (((++(Lvl)) & 7) ? \ + (Hx) >> 4 : \ + make_map_hash(Key, ((Lvl) >> 3))) /* erl_term.h stuff */ #define flatmap_get_values(x) (((Eterm *)(x)) + sizeof(flatmap_t)/sizeof(Eterm)) |