Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(store): clean up Memory, make mcopy pure #1153

Merged
merged 3 commits into from
Jul 13, 2023
Merged

Conversation

dk1a
Copy link
Contributor

@dk1a dk1a commented Jul 13, 2023

fixes #1086
fixes part of #1133

this significantly ups the gas cost of mcopy and consequently Slice.toBytes(), but we shouldn't need this memory copying in the first place, which I'll address in a later PR

(it doesn't affect much, only some dynamic fields)

@changeset-bot
Copy link

changeset-bot bot commented Jul 13, 2023

🦋 Changeset detected

Latest commit: 0cf1a50

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
@latticexyz/cli Patch
@latticexyz/common Patch
@latticexyz/store Patch
@latticexyz/world Patch
@latticexyz/std-client Patch
@latticexyz/block-logs-stream Patch
@latticexyz/config Patch
@latticexyz/dev-tools Patch
@latticexyz/network Patch
@latticexyz/protocol-parser Patch
@latticexyz/store-cache Patch
@latticexyz/store-sync Patch
@latticexyz/utils Patch
@latticexyz/react Patch
@latticexyz/ecs-browser Patch
@latticexyz/phaserx Patch
@latticexyz/recs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment on lines +439 to +441
assembly {
mstore(memoryPointer, dynamicDataLength)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for just mstore I think using assembly directly is clearer, and this method was only used in this 1 place

@dk1a dk1a marked this pull request as ready for review July 13, 2023 14:06
@dk1a dk1a requested review from alvrs and holic as code owners July 13, 2023 14:06
@dk1a dk1a merged commit 8d51a03 into main Jul 13, 2023
@dk1a dk1a deleted the dk1a/store-memory branch July 13, 2023 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up solidity warnings
2 participants