Skip to content

Lift/lower refactors inspired by map<K, V>#12753

Open
alexcrichton wants to merge 1 commit intobytecodealliance:mainfrom
alexcrichton:minor-refactors
Open

Lift/lower refactors inspired by map<K, V>#12753
alexcrichton wants to merge 1 commit intobytecodealliance:mainfrom
alexcrichton:minor-refactors

Conversation

@alexcrichton
Copy link
Member

In reading over #12216 I found a few related but also somewhat orthogonal refactors that I wanted to implement, and thus this commit. Changes here are:

  • Handling pointer pairs for lists/maps/strings is now more uniform with a single set of functions doing the lift/lower to flat/memory. Less "FIXME 4311" spread throughout effectively.

  • Conditional defines and organization of the HashMap-related impls were tweaked, for example impls on HashMap are now unconditional as well as TryHashMap. Some internals were refactored to in theory reduce complexity, but this is also subjective.

  • Lifting a map<K, V> now consumes fuel, a recent change, to ensure that resource exhaustion in the host is limited.

In reading over bytecodealliance#12216 I found a few related but also somewhat
orthogonal refactors that I wanted to implement, and thus this commit.
Changes here are:

* Handling pointer pairs for lists/maps/strings is now more uniform with
  a single set of functions doing the lift/lower to flat/memory. Less
  "FIXME 4311" spread throughout effectively.

* Conditional defines and organization of the `HashMap`-related impls
  were tweaked, for example impls on `HashMap` are now unconditional as
  well as `TryHashMap`. Some internals were refactored to in theory
  reduce complexity, but this is also subjective.

* Lifting a `map<K, V>` now consumes fuel, a recent change, to ensure
  that resource exhaustion in the host is limited.
@alexcrichton alexcrichton requested a review from a team as a code owner March 10, 2026 15:56
@alexcrichton alexcrichton requested review from fitzgen and removed request for a team March 10, 2026 15:56
@github-actions github-actions bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasmtime:api Related to the API of the `wasmtime` crate itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant