diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-02-17 20:17:45 +0100 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-02-17 20:17:45 +0100 |
commit | 964fb429de38159a9704f2c66fe94ac0182b38ec (patch) | |
tree | 4c0332fb036aa34fbe7e79c03b0442deeff1e5d5 /src | |
parent | 926a77a80ea1a2e4c0642dd3bedae520883361b3 (diff) |
ensure aligned memory in corruption detector
Diffstat (limited to 'src')
-rw-r--r-- | src/corruptionCheck.js | 1 |
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]); |