diff options
author | Lukas Larsson <[email protected]> | 2017-07-05 11:15:44 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2017-07-06 10:50:02 +0200 |
commit | 90d2a1c4b85ce8dab16c7000cb02ab947337a64f (patch) | |
tree | 4f41a54e60a412ca76848e50e1ccfa525c8619da /erts/emulator/beam | |
parent | f07821b47f8dcf69be22277e316167491a2ef295 (diff) | |
download | otp-90d2a1c4b85ce8dab16c7000cb02ab947337a64f.tar.gz otp-90d2a1c4b85ce8dab16c7000cb02ab947337a64f.tar.bz2 otp-90d2a1c4b85ce8dab16c7000cb02ab947337a64f.zip |
erts: Add HRelease endp assert
This assert makes sure that endp is correct and that
no other HAlloc has been done inbetween HAlloc and HRelease.
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r-- | erts/emulator/beam/erl_vm.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_vm.h b/erts/emulator/beam/erl_vm.h index 0b8d78c469..d077d3dea2 100644 --- a/erts/emulator/beam/erl_vm.h +++ b/erts/emulator/beam/erl_vm.h @@ -102,9 +102,11 @@ if ((ptr) == (endp)) { \ ; \ } else if (HEAP_START(p) <= (ptr) && (ptr) < HEAP_TOP(p)) { \ + ASSERT(HEAP_TOP(p) == (endp)); \ HEAP_TOP(p) = (ptr); \ } else { \ - erts_heap_frag_shrink(p, ptr); \ + ASSERT(MBUF(p)->mem + MBUF(p)->used_size == (endp)); \ + erts_heap_frag_shrink(p, ptr); \ } #define HeapWordsLeft(p) (HEAP_LIMIT(p) - HEAP_TOP(p)) |