Skip to content

Commit 60d513c

Browse files
authored
Updated yul.rst with feedback.
Updated yul.rst with explanation of 0x60 pointer choice.
1 parent 6439955 commit 60d513c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/yul.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,8 @@ An example Yul Object is shown below:
11621162
code {
11631163
function allocate(size) -> ptr {
11641164
ptr := mload(0x40)
1165-
if iszero(ptr) { ptr := 0x80 }
1165+
// 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.
1166+
if iszero(ptr) { ptr := 0x60 }
11661167
mstore(0x40, add(ptr, size))
11671168
}
11681169
@@ -1191,6 +1192,7 @@ An example Yul Object is shown below:
11911192
code {
11921193
function allocate(size) -> ptr {
11931194
ptr := mload(0x40)
1195+
// 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.
11941196
if iszero(ptr) { ptr := 0x60 }
11951197
mstore(0x40, add(ptr, size))
11961198
}

0 commit comments

Comments
 (0)