aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2019-08-16 09:43:16 +0200
committerJohn Högberg <[email protected]>2019-08-16 09:43:16 +0200
commit8da00999f89fe26caa1f4dc46a73fed775918135 (patch)
tree8f273e902648328d6d779f83791f6988957b4d06
parent4a722c8fe81d915120ac8506575fb4b1c89b67b6 (diff)
parent062c4d68a6d18b399714c477d329093dec10aedf (diff)
downloadotp-8da00999f89fe26caa1f4dc46a73fed775918135.tar.gz
otp-8da00999f89fe26caa1f4dc46a73fed775918135.tar.bz2
otp-8da00999f89fe26caa1f4dc46a73fed775918135.zip
Merge branch 'maint'
* maint: erts: Scan heap fragments for off-heap binaries
-rw-r--r--erts/emulator/beam/erl_bif_info.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c
index aa55bdab6a..d1ceffd23c 100644
--- a/erts/emulator/beam/erl_bif_info.c
+++ b/erts/emulator/beam/erl_bif_info.c
@@ -162,10 +162,10 @@ static Eterm current_stacktrace(ErtsHeapFactory *hfact, Process* rp,
Uint reserve_size);
static Eterm
-bld_bin_list(Uint **hpp, Uint *szp, ErlOffHeap* oh)
+bld_bin_list(Uint **hpp, Uint *szp, ErlOffHeap* oh, Eterm tail)
{
struct erl_off_heap_header* ohh;
- Eterm res = NIL;
+ Eterm res = tail;
Eterm tuple;
for (ohh = oh->first; ohh; ohh = ohh->next) {
@@ -1864,11 +1864,25 @@ process_info_aux(Process *c_p,
break;
case ERTS_PI_IX_BINARY: {
- Uint sz = 0;
- (void) bld_bin_list(NULL, &sz, &MSO(rp));
+ ErlHeapFragment *hfrag;
+ Uint sz;
+
+ res = NIL;
+ sz = 0;
+
+ (void)bld_bin_list(NULL, &sz, &MSO(rp), NIL);
+ for (hfrag = rp->mbuf; hfrag != NULL; hfrag = hfrag->next) {
+ (void)bld_bin_list(NULL, &sz, &hfrag->off_heap, NIL);
+ }
+
hp = erts_produce_heap(hfact, sz, reserve_size);
- res = bld_bin_list(&hp, NULL, &MSO(rp));
- break;
+
+ res = bld_bin_list(&hp, NULL, &MSO(rp), NIL);
+ for (hfrag = rp->mbuf; hfrag != NULL; hfrag = hfrag->next) {
+ res = bld_bin_list(&hp, NULL, &hfrag->off_heap, res);
+ }
+
+ break;
}
case ERTS_PI_IX_SEQUENTIAL_TRACE_TOKEN: {