diff options
author | Björn-Egil Dahlberg <[email protected]> | 2014-05-12 16:44:24 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2014-05-12 16:44:24 +0200 |
commit | 614bca0f5832f06bcc181c58b78e3371d79ec40d (patch) | |
tree | beb8d9d41d986641cbfdd116b358d6bd15aa9fe4 /erts/emulator/beam | |
parent | c563f5866b42a3479050241284fffc1245aebe7d (diff) | |
parent | e1d5e4841a657ad26254597dc8f2bb09a38c6646 (diff) | |
download | otp-614bca0f5832f06bcc181c58b78e3371d79ec40d.tar.gz otp-614bca0f5832f06bcc181c58b78e3371d79ec40d.tar.bz2 otp-614bca0f5832f06bcc181c58b78e3371d79ec40d.zip |
Merge branch 'egil/fix-erts_debug-size/OTP-11923' into maint
* egil/fix-erts_debug-size/OTP-11923:
erts: Update preloaded erts_internal.beam
erts: Add spec for erts_internal:map_to_tuple_keys/1
erts: Add testcase for erts_debug:size/1 Map terms
kernel: Fix erts_debug:size/1 to handle Map sizes
erts: Add erts_internal:map_to_tuple_keys/1
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r-- | erts/emulator/beam/bif.tab | 1 | ||||
-rw-r--r-- | erts/emulator/beam/erl_map.c | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/erts/emulator/beam/bif.tab b/erts/emulator/beam/bif.tab index 2d888862bf..fbdddf09db 100644 --- a/erts/emulator/beam/bif.tab +++ b/erts/emulator/beam/bif.tab @@ -157,6 +157,7 @@ bif erts_internal:binary_to_term/2 bif erts_internal:request_system_task/3 bif erts_internal:check_process_code/2 +bif erts_internal:map_to_tuple_keys/1 # inet_db support bif erlang:port_set_data/2 diff --git a/erts/emulator/beam/erl_map.c b/erts/emulator/beam/erl_map.c index fdd2d0c0f6..5e740aacdd 100644 --- a/erts/emulator/beam/erl_map.c +++ b/erts/emulator/beam/erl_map.c @@ -58,6 +58,8 @@ * - maps:size/1 * - maps:without/2 * + * DEBUG: for sharing calculation + * - erts_internal:map_to_tuple_keys/1 */ /* erlang:map_size/1 @@ -819,3 +821,17 @@ int erts_validate_and_sort_map(map_t* mp) } return 1; } + +/* + * erts_internal:map_to_tuple_keys/1 + * + * Used in erts_debug:size/1 + */ + +BIF_RETTYPE erts_internal_map_to_tuple_keys_1(BIF_ALIST_1) { + if (is_map(BIF_ARG_1)) { + map_t *mp = (map_t*)map_val(BIF_ARG_1); + BIF_RET(mp->keys); + } + BIF_ERROR(BIF_P, BADARG); +} |