aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_map.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-02-19 16:25:03 +0100
committerBjörn-Egil Dahlberg <[email protected]>2015-03-12 19:15:26 +0100
commit9cfaa729d7319ede30f62ffaaf82eb10fbaf8a60 (patch)
treeb08c2cc5a185e7f2f203f3150543fd1a385db6df /erts/emulator/beam/erl_map.c
parent7a12c43da25e3dcad54212f538ebae3dc13f5c2e (diff)
downloadotp-9cfaa729d7319ede30f62ffaaf82eb10fbaf8a60.tar.gz
otp-9cfaa729d7319ede30f62ffaaf82eb10fbaf8a60.tar.bz2
otp-9cfaa729d7319ede30f62ffaaf82eb10fbaf8a60.zip
erts: Move hashmap:size/1 to maps
Diffstat (limited to 'erts/emulator/beam/erl_map.c')
-rw-r--r--erts/emulator/beam/erl_map.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_map.c b/erts/emulator/beam/erl_map.c
index b2a16eb5ed..ecbb91bc33 100644
--- a/erts/emulator/beam/erl_map.c
+++ b/erts/emulator/beam/erl_map.c
@@ -77,6 +77,16 @@ BIF_RETTYPE map_size_1(BIF_ALIST_1) {
erts_bld_uint(NULL, &hsz, n);
hp = HAlloc(BIF_P, hsz);
BIF_RET(erts_bld_uint(&hp, NULL, n));
+ } else if (is_hashmap(BIF_ARG_1)) {
+ Eterm *head, *hp, res;
+ Uint size, hsz=0;
+
+ head = hashmap_val(BIF_ARG_1);
+ size = head[1];
+ (void) erts_bld_uint(NULL, &hsz, size);
+ hp = HAlloc(BIF_P, hsz);
+ res = erts_bld_uint(&hp, NULL, size);
+ BIF_RET(res);
}
BIF_ERROR(BIF_P, BADARG);