aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_message.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2016-08-31 15:39:43 +0200
committerRickard Green <[email protected]>2016-08-31 15:39:43 +0200
commitdafdc7c779b1f6bda54f9a4ea6fb1e26b5e3b096 (patch)
tree7d38635c30d670bcd1f4aa77e041924cc8db1a68 /erts/emulator/beam/erl_message.c
parent74fecb1c89c9f3149dc0e42b2a4a19827a28370f (diff)
parent2652d2f9b9f58746b80786fe7e62ae36b09bc890 (diff)
downloadotp-dafdc7c779b1f6bda54f9a4ea6fb1e26b5e3b096.tar.gz
otp-dafdc7c779b1f6bda54f9a4ea6fb1e26b5e3b096.tar.bz2
otp-dafdc7c779b1f6bda54f9a4ea6fb1e26b5e3b096.zip
Merge branch 'maint'
* maint: Ensure correct mbuf_sz value in process structure
Diffstat (limited to 'erts/emulator/beam/erl_message.c')
-rw-r--r--erts/emulator/beam/erl_message.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_message.c b/erts/emulator/beam/erl_message.c
index e9f0586edd..118adc0c1b 100644
--- a/erts/emulator/beam/erl_message.c
+++ b/erts/emulator/beam/erl_message.c
@@ -1845,3 +1845,20 @@ void erts_factory_undo(ErtsHeapFactory* factory)
factory->heap_frags = NULL;
#endif
}
+
+Uint
+erts_mbuf_size(Process *p)
+{
+ Uint sz = 0;
+ ErlHeapFragment* bp;
+ ErtsMessage* mp;
+
+ for (bp = p->mbuf; bp; bp = bp->next)
+ sz += bp->used_size;
+
+ for (mp = p->msg_frag; mp; mp = mp->next)
+ for (bp = erts_message_to_heap_frag(mp); bp; bp = bp->next)
+ sz += bp->used_size;
+
+ return sz;
+}