Skip to content

Commit 2f98e92

Browse files
dk1aalvrs
andauthored
feat(store): improve memory copy (#3400)
Co-authored-by: alvarius <[email protected]>
1 parent 9212386 commit 2f98e92

File tree

6 files changed

+80
-98
lines changed

6 files changed

+80
-98
lines changed

.changeset/hungry-olives-attack.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@latticexyz/store": patch
3+
---
4+
5+
`Memory.copy` now internally uses `mcopy`, which is available since solidity version 0.8.24

docs/pages/store/reference/misc.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1796,7 +1796,8 @@ function dataPointer(bytes memory data) internal pure returns (uint256 memoryPoi
17961796

17971797
Copies memory from one location to another.
17981798

1799-
_Safely copies memory in chunks of 32 bytes, then handles any residual bytes._
1799+
_Length does not have to be a multiple of 32, mcopy safely handles unaligned words.
1800+
Copying takes place as if an intermediate buffer was used, allowing the destination and source to overlap._
18001801

18011802
```solidity
18021803
function copy(uint256 fromPointer, uint256 toPointer, uint256 length) internal pure;

0 commit comments

Comments
 (0)