aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_map.h
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-02-19 16:53:32 +0100
committerBjörn-Egil Dahlberg <[email protected]>2015-03-12 19:15:26 +0100
commit903740ac57b00d404f430876b82cb21e0bb684a3 (patch)
tree1a5bfcf2ae2589ed5c8e50a848e2b708d907dd36 /erts/emulator/beam/erl_map.h
parent9cfaa729d7319ede30f62ffaaf82eb10fbaf8a60 (diff)
downloadotp-903740ac57b00d404f430876b82cb21e0bb684a3.tar.gz
otp-903740ac57b00d404f430876b82cb21e0bb684a3.tar.bz2
otp-903740ac57b00d404f430876b82cb21e0bb684a3.zip
erts: Move hashmap:to_list/1, keys/1 and values/1 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 2e02ca4677..c104e08e27 100644
--- a/erts/emulator/beam/erl_map.h
+++ b/erts/emulator/beam/erl_map.h
@@ -42,8 +42,12 @@ typedef struct map_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_size_rel(RTERM, BASE) hashmap_size(rterm2wterm(RTERM, BASE))
+
/* erl_term.h stuff */
#define make_map(x) make_boxed((Eterm*)(x))
#define make_map_rel(x, BASE) make_boxed_rel((Eterm*)(x),(BASE))
@@ -62,10 +66,13 @@ typedef struct map_s {
#define MAP_HEADER _make_header(1,_TAG_HEADER_MAP)
#define MAP_HEADER_SIZE (sizeof(map_t) / sizeof(Eterm))
+struct ErtsWStack_;
Eterm erts_maps_put(Process *p, Eterm key, Eterm value, Eterm map);
int erts_maps_update(Process *p, Eterm key, Eterm value, Eterm map, Eterm *res);
int erts_maps_remove(Process *p, Eterm key, Eterm map, Eterm *res);
int erts_validate_and_sort_map(map_t* map);
+void hashmap_iterator_init(struct ErtsWStack_* s, Eterm node);
+Eterm* hashmap_iterator_next(struct ErtsWStack_* s);
#if HALFWORD_HEAP
const Eterm *