aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-12-14 20:02:54 +0100
committerSverker Eriksson <[email protected]>2015-12-15 12:08:02 +0100
commit46a1a3b8c8819a117d7f48a864d8e0f5e08ac548 (patch)
tree350a770ca5a4821f0d842ba4a0b46741735419f7
parent0f32d250876e7bb226fb96e07fb31734ba7d16f2 (diff)
downloadotp-46a1a3b8c8819a117d7f48a864d8e0f5e08ac548.tar.gz
otp-46a1a3b8c8819a117d7f48a864d8e0f5e08ac548.tar.bz2
otp-46a1a3b8c8819a117d7f48a864d8e0f5e08ac548.zip
erts: Add 'fill_heap' to erts_debug:state_internal_state
to make it easy to provoke GC inside/after a BIF or instruction.
-rw-r--r--erts/emulator/beam/erl_bif_info.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c
index b44382cde8..caa1cb7608 100644
--- a/erts/emulator/beam/erl_bif_info.c
+++ b/erts/emulator/beam/erl_bif_info.c
@@ -4085,6 +4085,17 @@ BIF_RETTYPE erts_debug_set_internal_state_2(BIF_ALIST_2)
BIF_RET(am_ok);
}
}
+ else if (ERTS_IS_ATOM_STR("fill_heap", BIF_ARG_1)) {
+ UWord left = HeapWordsLeft(BIF_P);
+ if (left > 1) {
+ Eterm* hp = HAlloc(BIF_P, left);
+ *hp = make_pos_bignum_header(left - 1);
+ }
+ if (BIF_ARG_2 == am_true) {
+ FLAGS(BIF_P) |= F_NEED_FULLSWEEP;
+ }
+ BIF_RET(am_ok);
+ }
}
BIF_ERROR(BIF_P, BADARG);