diff options
author | Rickard Green <[email protected]> | 2016-06-28 17:40:45 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2016-08-30 16:58:15 +0200 |
commit | f36e430a1482ee91d7f8b5ff72477ee6882b876d (patch) | |
tree | 879cdece142a9f7d250e3e4c1e68ceb010a4c6fa /erts/emulator/beam/erl_process.h | |
parent | 925984e94f2c1933bb659dfb626c191982b7c8d4 (diff) | |
download | otp-f36e430a1482ee91d7f8b5ff72477ee6882b876d.tar.gz otp-f36e430a1482ee91d7f8b5ff72477ee6882b876d.tar.bz2 otp-f36e430a1482ee91d7f8b5ff72477ee6882b876d.zip |
Ensure correct mbuf_sz value in process structure
Diffstat (limited to 'erts/emulator/beam/erl_process.h')
-rw-r--r-- | erts/emulator/beam/erl_process.h | 5 |
1 files changed, 4 insertions, 1 deletions
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 */ |