diff options
author | chriseth <chris@ethereum.org> | 2018-04-04 20:37:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-04 20:37:43 +0800 |
commit | 2fe5607a5a6618f27f4ed5c1effb4273c662ee3a (patch) | |
tree | aef8f1dc5fa400e27ea5072f10c64f7ec5374b22 /libsolidity/codegen/CompilerUtils.h | |
parent | c5c5b23ff485075836b0b80db6e7cfebf0eebb4b (diff) | |
parent | 0cbe55005de79b0f7c5c770d50c3eb87df019789 (diff) | |
download | dexon-solidity-2fe5607a5a6618f27f4ed5c1effb4273c662ee3a.tar dexon-solidity-2fe5607a5a6618f27f4ed5c1effb4273c662ee3a.tar.gz dexon-solidity-2fe5607a5a6618f27f4ed5c1effb4273c662ee3a.tar.bz2 dexon-solidity-2fe5607a5a6618f27f4ed5c1effb4273c662ee3a.tar.lz dexon-solidity-2fe5607a5a6618f27f4ed5c1effb4273c662ee3a.tar.xz dexon-solidity-2fe5607a5a6618f27f4ed5c1effb4273c662ee3a.tar.zst dexon-solidity-2fe5607a5a6618f27f4ed5c1effb4273c662ee3a.zip |
Merge pull request #3721 from ethereum/simpleDynArray
Create empty dynamic memory arrays more efficiently.
Diffstat (limited to 'libsolidity/codegen/CompilerUtils.h')
-rw-r--r-- | libsolidity/codegen/CompilerUtils.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libsolidity/codegen/CompilerUtils.h b/libsolidity/codegen/CompilerUtils.h index 389673ef..a32c5c6e 100644 --- a/libsolidity/codegen/CompilerUtils.h +++ b/libsolidity/codegen/CompilerUtils.h @@ -210,6 +210,9 @@ public: /// Creates a zero-value for the given type and puts it onto the stack. This might allocate /// memory for memory references. void pushZeroValue(Type const& _type); + /// Pushes a pointer to the stack that points to a (potentially shared) location in memory + /// that always contains a zero. It is not allowed to write there. + void pushZeroPointer(); /// Moves the value that is at the top of the stack to a stack variable. void moveToStackVariable(VariableDeclaration const& _variable); @@ -255,6 +258,10 @@ public: /// Position of the free-memory-pointer in memory; static const size_t freeMemoryPointer; + /// Position of the memory slot that is always zero. + static const size_t zeroPointer; + /// Starting offset for memory available to the user (aka the contract). + static const size_t generalPurposeMemoryStart; private: /// Address of the precompiled identity contract. |