Memory
Modified from skozin's work for Lido. Switch over to the MCOPY instruction once available - https://eips.ethereum.org/EIPS/eip-5656.
Functions
unsafeAllocateBytes
Allocates a memory byte array of len
bytes without zeroing it out.
Parameters
Name | Type | Description |
---|---|---|
|
| The length of the byte array to allocate. |
memcpy
Performs a memory copy of len
bytes from position src
to position dst
.
Parameters
Name | Type | Description |
---|---|---|
|
| The source memory position. |
|
| The destination memory position. |
|
| The number of bytes to copy. |
copyBytes
Copies len
bytes from src
, starting at position srcStart
, into dst
, starting at position dstStart
into dst
.
Parameters
Name | Type | Description |
---|---|---|
|
| The source bytes array. |
|
| The destination bytes array. |
|
| The starting position in |
|
| The starting position in |
|
| The number of bytes to copy. |
copyBytes
Copies bytes from src
to dst
, starting at position dstStart
into dst
.
Parameters
Name | Type | Description |
---|---|---|
|
| The source bytes array. |
|
| The destination bytes array. |
|
| The starting position in |
Errors
BYTES_ARRAY_OUT_OF_BOUNDS
Thrown when there is an attempt to access an out of bounds array element.
Last updated