grovesNL edited PR #7828.
grovesNL edited a comment on PR #7828:
Thanks for clarifying! I updated the PR to match the scheme you described.
Is the purpose of including
CompiledModuleId
onModuleExport
just out of convenience for user code, or should we compare these somewhere duringget_module_export
?
github-actions[bot] commented on PR #7828:
Subscribe to Label Action
cc @peterhuene
<details>
This issue or pull request has been labeled: "wasmtime:api"Thus the following users have been cc'd because of the following labels:
- peterhuene: wasmtime:api
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
alexcrichton submitted PR review:
Looks great thanks! Just a few minor comments but otherwise looks good to go.
Is the purpose of including CompiledModuleId on ModuleExport just out of convenience for user code, or should we compare these somewhere during get_module_export?
I commented below as well, but we'll want to check this when looking up exports to prevent this mistake of using the wrong module's exports to index an instance.
alexcrichton created PR review comment:
Could the above method delegate to this one? Additionally could this one lookup in
data.exports
to use the cache if it's already filled in? And finally, mind adding a link toModule::get_export_index
in the docs of this function?
alexcrichton submitted PR review:
Looks great thanks! Just a few minor comments but otherwise looks good to go.
Is the purpose of including CompiledModuleId on ModuleExport just out of convenience for user code, or should we compare these somewhere during get_module_export?
I commented below as well, but we'll want to check this when looking up exports to prevent this mistake of using the wrong module's exports to index an instance.
alexcrichton created PR review comment:
Mind making these private and/or
pub(crate)
? Ideally users shouldn't have to actually look at these fields.
alexcrichton created PR review comment:
Also, can this method perform a check that
export.module
is the same as the module used to create this instance? That prevents a mistake where you get aModuleExport
from one module but look it up in the wrong instance.
grovesNL updated PR #7828.
grovesNL commented on PR #7828:
Thank you for the feedback! I updated the PR. I moved the lookup into the shared
_get_export
function and pass the entity and index to that instead (checking the module ID is only necessary for the new function).
grovesNL updated PR #7828.
grovesNL updated PR #7828.
alexcrichton submitted PR review:
Thanks!
alexcrichton merged PR #7828.
Last updated: Nov 22 2024 at 17:03 UTC