aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_debug.c
diff options
context:
space:
mode:
authorNikolaos S. Papaspyrou <nickie@softlab.ntua.gr>2012-06-09 00:19:28 +0300
committerBjörn-Egil Dahlberg <egil@erlang.org>2015-11-17 14:33:12 +0100
commitcfe998988c942bed0fbf026c00a2531fdf5aba7c (patch)
treeef4692fdb491b8aac4ff1da8d01291cc5da3a816 /erts/emulator/beam/beam_debug.c
parentd5711cb70be9ad2e5c78839e8a368900ba248a4a (diff)
downloadotp-cfe998988c942bed0fbf026c00a2531fdf5aba7c.tar.gz
otp-cfe998988c942bed0fbf026c00a2531fdf5aba7c.tar.bz2
otp-cfe998988c942bed0fbf026c00a2531fdf5aba7c.zip
Add the BIF size_shared/1 and debug cleanup
Diffstat (limited to 'erts/emulator/beam/beam_debug.c')
-rw-r--r--erts/emulator/beam/beam_debug.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c
index e989310789..40e3f4db4e 100644
--- a/erts/emulator/beam/beam_debug.c
+++ b/erts/emulator/beam/beam_debug.c
@@ -73,6 +73,20 @@ erts_debug_flat_size_1(BIF_ALIST_1)
}
}
+BIF_RETTYPE
+erts_debug_size_shared_1(BIF_ALIST_1)
+{
+ Process* p = BIF_P;
+ Eterm term = BIF_ARG_1;
+ Uint size = size_shared(term);
+
+ if (IS_USMALL(0, size)) {
+ BIF_RET(make_small(size));
+ } else {
+ Eterm* hp = HAlloc(p, BIG_UINT_HEAP_SIZE);
+ BIF_RET(uint_to_big(size, hp));
+ }
+}
BIF_RETTYPE
erts_debug_breakpoint_2(BIF_ALIST_2)