aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2017-07-05 11:15:44 +0200
committerLukas Larsson <[email protected]>2017-07-06 10:50:02 +0200
commit90d2a1c4b85ce8dab16c7000cb02ab947337a64f (patch)
tree4f41a54e60a412ca76848e50e1ccfa525c8619da /erts/emulator
parentf07821b47f8dcf69be22277e316167491a2ef295 (diff)
downloadotp-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')
-rw-r--r--erts/emulator/beam/erl_vm.h4
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))