diff options
author | Sverker Eriksson <[email protected]> | 2017-01-05 20:43:49 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2017-01-05 20:43:49 +0100 |
commit | 287edce0090a14fdd88a9e10d13327e74e52831a (patch) | |
tree | b21fd7d3b896e99465eb54c179dd5c8811593f34 /erts/emulator/beam/erl_trace.c | |
parent | 5f4d538b2abfd1ab3f495879996edaa004309623 (diff) | |
download | otp-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.c | 5 |
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); } } |