Scratch Space - Algorand Specifications
Keyboard shortcuts
Press β or β to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
- Auto
- Light
- Dark
Algorand Specifications
In addition to the Stack, the AVM has a Scratch Space (or heap) of 256256 positions.
Like Stack values, scratch locations may hold stackValues (of either uint64 or bytes types) and are initialized as zeroed-out uint64 values.
The Scratch Space is an additional area of volatile memory used at runtime. Itβs useful for storing values needed multiple times during program execution, or that stay the same for long periods. It provides a convenient place to keep such persistent or reusable data during the program execution.
Important
IMPLEMENTATION:
Scratch Space reference implementation.
Scratch Space locations are mapped to 00-based integer index.
The Scratch Space is accessed by the load(s) and store(s) opcodes which move data respectively:
- From the Scratch Space to the Stack;
- From the Stack to the Scratch Space.
Application calls MAY inspect the final Scratch Space of earlier application call transactions in the same group using gload(s')(s), where:
sis the integer index of a Scratch Space location,s'is the integer index of an earlier application call transaction in the group.