aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_trace.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-01-17 15:50:27 +0100
committerSverker Eriksson <[email protected]>2017-01-17 15:50:27 +0100
commit9b6643e4c573e4a5536a48f8115f12d0b99f9d41 (patch)
treed5948a5a507c10b3699c79bc3b1fd4f003d274f7 /erts/emulator/beam/erl_trace.c
parentec2e03ad47d38400ac39dbc34911705fd50315aa (diff)
parent287edce0090a14fdd88a9e10d13327e74e52831a (diff)
downloadotp-9b6643e4c573e4a5536a48f8115f12d0b99f9d41.tar.gz
otp-9b6643e4c573e4a5536a48f8115f12d0b99f9d41.tar.bz2
otp-9b6643e4c573e4a5536a48f8115f12d0b99f9d41.zip
Merge branch 'sverker/trace_gc-bug/OTP-14154' into maint
* sverker/trace_gc-bug: erts: Fix GC tracing to use temp heap erts: Assert sufficient space need after GC
Diffstat (limited to 'erts/emulator/beam/erl_trace.c')
-rw-r--r--erts/emulator/beam/erl_trace.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_trace.c b/erts/emulator/beam/erl_trace.c
index 8c84303997..ac9e91e31f 100644
--- a/erts/emulator/beam/erl_trace.c
+++ b/erts/emulator/beam/erl_trace.c
@@ -1436,6 +1436,7 @@ void
trace_gc(Process *p, Eterm what, Uint size, Eterm msg)
{
ErtsTracerNif *tnif = NULL;
+ Eterm* o_hp = NULL;
Eterm* hp;
Uint sz = 0;
Eterm tup;
@@ -1446,7 +1447,7 @@ trace_gc(Process *p, Eterm what, Uint size, Eterm msg)
if (is_non_value(msg)) {
(void) erts_process_gc_info(p, &sz, NULL, 0, 0);
- hp = HAlloc(p, sz + 3 + 2);
+ o_hp = hp = erts_alloc(ERTS_ALC_T_TMP, (sz + 3 + 2) * sizeof(Eterm));
msg = erts_process_gc_info(p, NULL, &hp, 0, 0);
tup = TUPLE2(hp, am_wordsize, make_small(size)); hp += 3;
@@ -1455,6 +1456,8 @@ trace_gc(Process *p, Eterm what, Uint size, Eterm msg)
send_to_tracer_nif(p, &p->common, p->common.id, tnif, TRACE_FUN_T_GC,
what, msg, THE_NON_VALUE, am_true);
+ if (o_hp)
+ erts_free(ERTS_ALC_T_TMP, o_hp);
}
}