From f36e430a1482ee91d7f8b5ff72477ee6882b876d Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 28 Jun 2016 17:40:45 +0200 Subject: Ensure correct mbuf_sz value in process structure --- erts/emulator/beam/erl_process.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'erts/emulator/beam/erl_process.h') diff --git a/erts/emulator/beam/erl_process.h b/erts/emulator/beam/erl_process.h index 94c13bb948..f92c745050 100644 --- a/erts/emulator/beam/erl_process.h +++ b/erts/emulator/beam/erl_process.h @@ -1328,10 +1328,13 @@ ERTS_GLB_INLINE void erts_heap_frag_shrink(Process* p, Eterm* hp); ERTS_GLB_INLINE void erts_heap_frag_shrink(Process* p, Eterm* hp) { ErlHeapFragment* hf = MBUF(p); + Uint sz; ASSERT(hf!=NULL && (hp - hf->mem < hf->alloc_size)); - hf->used_size = hp - hf->mem; + sz = hp - hf->mem; + p->mbuf_sz -= hf->used_size - sz; + hf->used_size = sz; } #endif /* inline */ -- cgit v1.2.3