aboutsummaryrefslogtreecommitdiff
path: root/src/corruptionCheck.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/corruptionCheck.js')
-rw-r--r--src/corruptionCheck.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corruptionCheck.js b/src/corruptionCheck.js
index 9c8794cd..ae2a0bdf 100644
--- a/src/corruptionCheck.js
+++ b/src/corruptionCheck.js
@@ -21,6 +21,7 @@ var CorruptionChecker = {
malloc: function(size) {
CorruptionChecker.checkAll();
assert(size > 0); // some mallocs accept zero - fix your code if you want to use this tool
+ size = (size+7)&(~7);
var allocation = CorruptionChecker.realMalloc(size*(1+2*CorruptionChecker.BUFFER_FACTOR));
var ptr = allocation + size*CorruptionChecker.BUFFER_FACTOR;
assert(!CorruptionChecker.ptrs[ptr]);