Support struct values in storage maps - #1494
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5afc5c8632
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 61e216b0e3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
24a36a4 to
ed1f67f
Compare
ed1f67f to
7427099
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74270991ee
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
42c8cb2 to
2f448f0
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f448f0eda
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13b15271c2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Adds typed pointers to
StorageMapentries, allowing maps to store and access multi-word values such as structs without requiring those values to implementWordRepr.Pointer-based access uses the normal storage effect model. Existing
getandsetAPIs remain available for single-wordWordReprvalues.API
StorageMap::ptr, returning a read-onlyStoragePtr<V>.StorageMap::mut_ptr, returning a mutableStorageMutPtr<V>.StorageMap::getandStorageMap::setrestricted toV: WordRepr.Storage layout
The map entry hash is treated as the base storage slot for the value. Aggregate fields are projected relative to that slot using the compiler's storage layout.
This PR also defines consistent packed storage layout for nominal structs:
HIR layout reporting and MIR/codegen now use the same shared field-layout planner. The same rules therefore apply to both ordinary contract struct fields and structs reached through storage-map entry pointers. Memory and ABI layouts are unchanged.
Example
The read-only pointer can inspect the entry, while the mutable pointer can replace the value or update individual fields through normal storage-provider semantics.