Started to learn OPCODEs and the term free memory pointer as well as offset are frequently mentioned. What do they mean?
1 Answer
The free memory pointer is a pointer (i.e. shows where to go) to the next available slot of memory. Meaning that if you need to create a new uint256 for exemple, the free memory pointer will let the EVM know where to create the new uint256. Then since that spot is now occupied by your newly created uint256, the free memory pointer will be updated to a new, unoccupied memory slot. Read me here.
Offset is just the number of bytes to offset the current reading target. So if my pointer points here
v
0x010203040506070809101a1b1c1d1e1f
pointing to the first byte, i can offset it of, let's say 5, and my memory pointer will be there:
v
0x010203040506070809101a1b1c1d1e1f
Hope this helps!