Merge pull request #13374 from 0xpranay/patch-2

Update the default free memory pointer in Yul.rst
This commit is contained in:
Leo 2022-08-13 15:55:15 +02:00 committed by GitHub
commit a78a2bcf34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1162,6 +1162,7 @@ An example Yul Object is shown below:
code {
function allocate(size) -> ptr {
ptr := mload(0x40)
// Note that Solidity generated IR code reserves memory offset ``0x60`` as well, but a pure Yul object is free to use memory as it chooses.
if iszero(ptr) { ptr := 0x60 }
mstore(0x40, add(ptr, size))
}
@ -1191,6 +1192,7 @@ An example Yul Object is shown below:
code {
function allocate(size) -> ptr {
ptr := mload(0x40)
// Note that Solidity generated IR code reserves memory offset ``0x60`` as well, but a pure Yul object is free to use memory as it chooses.
if iszero(ptr) { ptr := 0x60 }
mstore(0x40, add(ptr, size))
}