mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add note about memory arrays to 'Layout in Memory' section
Copied from the Inlien Assembly part
This commit is contained in:
parent
7247e72d8b
commit
8226869579
@ -371,6 +371,12 @@ is used as initial value for dynamic memory arrays and should never be written t
|
||||
|
||||
Solidity always places new objects at the free memory pointer and memory is never freed (this might change in the future).
|
||||
|
||||
Elements in memory arrays in Solidity always occupy multiples of 32 bytes (this
|
||||
is even true for ``byte[]``, but not for ``bytes`` and ``string``).
|
||||
Multi-dimensional memory arrays are pointers to memory arrays. The length of a
|
||||
dynamic array is stored at the first slot of the array and followed by the array
|
||||
elements.
|
||||
|
||||
.. warning::
|
||||
There are some operations in Solidity that need a temporary memory area larger than 64 bytes and therefore will not fit into the scratch space. They will be placed where the free memory points to, but given their short lifetime, the pointer is not updated. The memory may or may not be zeroed out. Because of this, one shouldn't expect the free memory to point to zeroed out memory.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user