diff options
author | Björn-Egil Dahlberg <[email protected]> | 2015-02-19 16:25:03 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2015-03-12 19:15:26 +0100 |
commit | 9cfaa729d7319ede30f62ffaaf82eb10fbaf8a60 (patch) | |
tree | b08c2cc5a185e7f2f203f3150543fd1a385db6df /erts/emulator/beam/erl_map.c | |
parent | 7a12c43da25e3dcad54212f538ebae3dc13f5c2e (diff) | |
download | otp-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.c | 10 |
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); |