mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Round up allocations to multiples of 32.
This commit is contained in:
committed by
Alex Beregszaszi
parent
31ee06d945
commit
db4b39e09e
@@ -70,7 +70,7 @@ object \"C_11\" {
|
||||
|
||||
function allocateMemory(size) -> memPtr {
|
||||
memPtr := mload(64)
|
||||
let newFreePtr := add(memPtr, size)
|
||||
let newFreePtr := add(memPtr, round_up_to_mul_of_32(size))
|
||||
// protect against overflow
|
||||
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
|
||||
mstore(64, newFreePtr)
|
||||
|
||||
Reference in New Issue
Block a user