aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_map.c
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/erl_map.c
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/erl_map.c')
-rw-r--r--erts/emulator/beam/erl_map.c16
1 files changed, 16 insertions, 0 deletions
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);
+}