diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2016-10-12 06:51:09 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2016-10-12 16:15:06 +0800 |
commit | 66c6c746998b853cde52225ce73818b5496c79c5 (patch) | |
tree | de5616ac5643bb7b3aa965f35dfd829a74f55c6b /docs | |
parent | 3d12c2ddc72d15dfcf599a089f104a2a5c224f41 (diff) | |
download | dexon-solidity-66c6c746998b853cde52225ce73818b5496c79c5.tar dexon-solidity-66c6c746998b853cde52225ce73818b5496c79c5.tar.gz dexon-solidity-66c6c746998b853cde52225ce73818b5496c79c5.tar.bz2 dexon-solidity-66c6c746998b853cde52225ce73818b5496c79c5.tar.lz dexon-solidity-66c6c746998b853cde52225ce73818b5496c79c5.tar.xz dexon-solidity-66c6c746998b853cde52225ce73818b5496c79c5.tar.zst dexon-solidity-66c6c746998b853cde52225ce73818b5496c79c5.zip |
Explain how scratch space affects the free memory pointer
Diffstat (limited to 'docs')
-rw-r--r-- | docs/miscellaneous.rst | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/miscellaneous.rst b/docs/miscellaneous.rst index 47da33b8..b631a2e4 100644 --- a/docs/miscellaneous.rst +++ b/docs/miscellaneous.rst @@ -64,7 +64,12 @@ Solidity reserves three 256-bit slots: - 0 - 64: scratch space for hashing methods - 64 - 96: currently allocated memory size (aka. free memory pointer) -Solidity always places new objects at the free memory pointer and memory is never freed. +Scratch space can be used between statements (ie. within inline assembly). + +Solidity always places new objects at the free memory pointer and memory is never freed (this might change in the future). + +.. 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 lifecycle, 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 be zeroed out. .. index: memory layout |