mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Document new argument to setimmutable.
This commit is contained in:
parent
26cc6b7a95
commit
65dd463fd2
10
docs/yul.rst
10
docs/yul.rst
@ -920,12 +920,12 @@ For the EVM, the ``datacopy`` function is equivalent to ``codecopy``.
|
||||
setimmutable, loadimmutable
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The functions ``setimmutable("name", value)`` and ``loadimmutable("name")`` are
|
||||
The functions ``setimmutable(offset, "name", value)`` and ``loadimmutable("name")`` are
|
||||
used for the immutable mechanism in Solidity and do not nicely map to pure Yul.
|
||||
The function ``setimmutable`` assumes that the runtime code of a contract
|
||||
is currently copied to memory at offset zero. The call to ``setimmutable("name", value)``
|
||||
will store ``value`` at all points in memory that contain a call to
|
||||
``loadimmutable("name")``.
|
||||
The call to ``setimmutable(offset, "name", value)`` assumes that the runtime code of the contract
|
||||
containing the given named immutable was copied to memory at offset ``offset`` and will write ``value`` to all
|
||||
positions in memory (relative to ``offset``) that contain the placeholder that was generated for calls
|
||||
to ``loadimmutable("name")`` in the runtime code.
|
||||
|
||||
|
||||
linkersymbol
|
||||
|
Loading…
Reference in New Issue
Block a user