From bc0960c095e9482ba0f452c9df3623f5c9c54e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Mon, 30 Sep 2013 20:13:07 +0200 Subject: erts: Introduce more Maps BIFs * map:remove/2 * map:keys/1 * map:values/1 * map:is_key/2 * map:update/3 - Equivalent to ':=' operator in #{ K := V } maps. * map:from_list/1 - map:from_list/1 takes any unsorted key/value list, [{K,V}], and produces a map. Duplicate keys are removed. The latest key is kept. * map:find/2 - Searches for a pair that *equals* input key. * map:merge/2 - Merge two maps to one map. --- erts/emulator/beam/erl_map.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'erts/emulator/beam/erl_map.h') diff --git a/erts/emulator/beam/erl_map.h b/erts/emulator/beam/erl_map.h index ca8ce0f974..4f0d26e100 100644 --- a/erts/emulator/beam/erl_map.h +++ b/erts/emulator/beam/erl_map.h @@ -33,11 +33,12 @@ typedef struct map_s { * * ----------- * Eterm THING - * Eterm Keys -> {K1, K2, K3, ..., Kn} where n = arity + * Uint size + * Eterm Keys -> {K1, K2, K3, ..., Kn} where n = size * ---- * Eterm V1 * ... - * Eterm Vn, where n = arity + * Eterm Vn, where n = size * ----------- */ @@ -59,6 +60,7 @@ typedef struct map_s { #define map_get_size(x) (((map_t*)(x))->size) #define MAP_HEADER _make_header(1,_TAG_HEADER_MAP) +#define MAP_HEADER_SIZE (sizeof(map_t) / sizeof(Eterm)) #endif -- cgit v1.2.3