aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-04-30 14:47:24 +0200
committerBjörn-Egil Dahlberg <[email protected]>2014-04-30 14:47:24 +0200
commit88fb069f83c39a47f65809ee5d6e7cadc170e56b (patch)
treeddc3c6dd2fa61262582eae2e8b52d895d4f96e81 /erts/emulator/beam
parentaca0b6182b039333b4c963938878d9eecc85e5a1 (diff)
downloadotp-88fb069f83c39a47f65809ee5d6e7cadc170e56b.tar.gz
otp-88fb069f83c39a47f65809ee5d6e7cadc170e56b.tar.bz2
otp-88fb069f83c39a47f65809ee5d6e7cadc170e56b.zip
erts: Add erts_internal:map_to_tuple_keys/1
* Used for introspection. * Will return the internal key tuple if applicable * Not documented - not for public use
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/bif.tab1
-rw-r--r--erts/emulator/beam/erl_map.c16
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);
+}