aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_map.h
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-02-23 11:48:46 +0100
committerBjörn-Egil Dahlberg <[email protected]>2015-03-12 19:15:26 +0100
commitf659c631f33ad86e7532c7198bbce6d7e07fe1dd (patch)
tree017d34e85d8e65b6b1bfe521404c8dd45495d312 /erts/emulator/beam/erl_map.h
parent7da662fb9eb519625b3833fec34419c32620f041 (diff)
downloadotp-f659c631f33ad86e7532c7198bbce6d7e07fe1dd.tar.gz
otp-f659c631f33ad86e7532c7198bbce6d7e07fe1dd.tar.bz2
otp-f659c631f33ad86e7532c7198bbce6d7e07fe1dd.zip
erts: Move hashmap:get/2, find/2 and is_key/2 to maps
Diffstat (limited to 'erts/emulator/beam/erl_map.h')
-rw-r--r--erts/emulator/beam/erl_map.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_map.h b/erts/emulator/beam/erl_map.h
index c104e08e27..48bc316e3b 100644
--- a/erts/emulator/beam/erl_map.h
+++ b/erts/emulator/beam/erl_map.h
@@ -47,6 +47,13 @@ typedef struct map_s {
#define hashmap_size(x) (((hashmap_head_t*) hashmap_val(x))->size)
#define hashmap_size_rel(RTERM, BASE) hashmap_size(rterm2wterm(RTERM, BASE))
+#define hashmap_make_hash(Key) make_hash2(Key)
+
+#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)))
+
/* erl_term.h stuff */
#define make_map(x) make_boxed((Eterm*)(x))