aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_trace.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-01-05 20:43:49 +0100
committerSverker Eriksson <[email protected]>2017-01-05 20:43:49 +0100
commit287edce0090a14fdd88a9e10d13327e74e52831a (patch)
treeb21fd7d3b896e99465eb54c179dd5c8811593f34 /erts/emulator/beam/erl_trace.c
parent5f4d538b2abfd1ab3f495879996edaa004309623 (diff)
downloadotp-287edce0090a14fdd88a9e10d13327e74e52831a.tar.gz
otp-287edce0090a14fdd88a9e10d13327e74e52831a.tar.bz2
otp-287edce0090a14fdd88a9e10d13327e74e52831a.zip
erts: Fix GC tracing to use temp heap
Can't use HAlloc as it might consume part of callers 'need'.
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);
}
}