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

vmlogic: maintain memory by a Box #11614

Merged
merged 2 commits into from
Jun 19, 2024
Merged

Conversation

nagisa
Copy link
Collaborator

@nagisa nagisa commented Jun 19, 2024

This is a part of an effort to drop the lifetime from the VMLogic structure in order to make it more straightforward to have it live for a longer duration alongside the instance and not force our hand in pretty much "create-execute contract-drop" flow.

Part of #11319

Copy link
Contributor

@wacban wacban left a comment

Choose a reason for hiding this comment

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

LGTM but please mind I have no expertise here :)

This is a part of an effort to drop the lifetime from the `VMLogic`
structure in order to make it more straightforward to have it live for a
longer duration alongside the instance and not force our hand in pretty
much "create-execute contract-drop" flow.
@nagisa nagisa force-pushed the delifetimes-vmlogic-some-0 branch from f2a0b40 to 5bfbe8a Compare June 19, 2024 12:52
@nagisa nagisa enabled auto-merge June 19, 2024 12:53
@nagisa nagisa added this pull request to the merge queue Jun 19, 2024
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

Project coverage is 71.48%. Comparing base (3e3137f) to head (5bfbe8a).

Files Patch % Lines
runtime/near-vm-runner/src/wasmer_runner.rs 0.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11614      +/-   ##
==========================================
+ Coverage   71.46%   71.48%   +0.02%     
==========================================
  Files         788      788              
  Lines      160854   160854              
  Branches   160854   160854              
==========================================
+ Hits       114947   114992      +45     
+ Misses      40887    40843      -44     
+ Partials     5020     5019       -1     
Flag Coverage Δ
backward-compatibility 0.23% <0.00%> (ø)
db-migration 0.23% <0.00%> (ø)
genesis-check 1.35% <0.00%> (ø)
integration-tests 37.68% <64.28%> (-0.02%) ⬇️
linux 68.90% <85.71%> (+0.02%) ⬆️
linux-nightly 70.97% <85.71%> (+0.03%) ⬆️
macos 52.57% <100.00%> (+0.01%) ⬆️
pytests 1.59% <0.00%> (ø)
sanity-checks 1.38% <0.00%> (ø)
unittests 66.15% <85.71%> (+0.02%) ⬆️
upgradability 0.28% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Merged via the queue into near:master with commit cd7526d Jun 19, 2024
29 of 30 checks passed
@nagisa nagisa deleted the delifetimes-vmlogic-some-0 branch June 19, 2024 13:36
github-merge-queue bot pushed a commit that referenced this pull request Jun 20, 2024
…11615)

`VMLogic` containing a lifetime makes it difficult to have it live for
any longer than a short sequence of `instantiate-link-run` and is one of
the reasons why we're forced to have some unsafe code in our linking
code.

This refactor replaces some of the reference fields with `Arc`s,
`Box`es, etc. This is not a complete refactor, I intend to do the
remainder as a follow-up.

Based on #11614
Part of #11319
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.

2 participants