diff options
author | Sverker Eriksson <[email protected]> | 2015-03-20 20:02:16 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2015-03-20 20:02:16 +0100 |
commit | 74099492bee421c4829537bca3c4bc0c4fbec031 (patch) | |
tree | 091301e2213ded2d211ee4ad451c1ede1b9da49c /erts/emulator/beam/erl_bif_info.c | |
parent | c0d3f4cbb5775a9214366e0d9cb76847d69c3459 (diff) | |
parent | c1be2e5baed4794f7017dab9558afe8a737b63ee (diff) | |
download | otp-74099492bee421c4829537bca3c4bc0c4fbec031.tar.gz otp-74099492bee421c4829537bca3c4bc0c4fbec031.tar.bz2 otp-74099492bee421c4829537bca3c4bc0c4fbec031.zip |
Merge branch 'sverk/hamt-overestimate/OTP-12585'
* sverk/hamt-overestimate/OTP-12585:
erts: Add test map_SUITE:t_hashmap_balance
erts: Fix hashmap overestimation
erts: Silence valgrind warning in nif_SUITE.c
Diffstat (limited to 'erts/emulator/beam/erl_bif_info.c')
-rw-r--r-- | erts/emulator/beam/erl_bif_info.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c index d750e34be3..0774ab51af 100644 --- a/erts/emulator/beam/erl_bif_info.c +++ b/erts/emulator/beam/erl_bif_info.c @@ -3597,6 +3597,26 @@ BIF_RETTYPE erts_debug_get_internal_state_1(BIF_ALIST_1) BIF_RET(erts_debug_reader_groups_map(BIF_P, (int) groups)); } + else if (ERTS_IS_ATOM_STR("internal_hash", tp[1])) { + Uint hash = (Uint) make_internal_hash(tp[2]); + Uint hsz = 0; + Eterm* hp; + erts_bld_uint(NULL, &hsz, hash); + hp = HAlloc(BIF_P,hsz); + return erts_bld_uint(&hp, NULL, hash); + } + else if (ERTS_IS_ATOM_STR("atom", tp[1])) { + Uint ix; + if (!term_to_Uint(tp[2], &ix)) + BIF_ERROR(BIF_P, BADARG); + while (ix >= atom_table_size()) { + char tmp[20]; + erts_snprintf(tmp, sizeof(tmp), "am%x", atom_table_size()); + erts_atom_put((byte *) tmp, strlen(tmp), ERTS_ATOM_ENC_LATIN1, 1); + } + return make_atom(ix); + } + break; } default: |