Round up allocations to multiples of 32.

This commit is contained in:
chriseth
2021-01-14 21:52:17 +00:00
committed by Alex Beregszaszi
parent 31ee06d945
commit db4b39e09e
20 changed files with 86 additions and 58 deletions
@@ -54,7 +54,7 @@ object "Arraysum_34" {
function allocateMemory(size) -> memPtr
{
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
let newFreePtr := add(memPtr, and(add(size, 31), not(31)))
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr))
{
mstore(0, shl(224, 0x4e487b71))