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

Do not deallocate disabled GC heaps via the instance allocator #9180

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Aug 28, 2024

When the reference types proposal is disabled, we don't allocate a GC heap from the instance allocator, we instead create a DisabledGcHeap. Rather than returning this to the instance allocator when we're done with it, which won't even know what to do with it since the instance allocator didn't create the GC heap, we simply rely on the DisabledGcHeap's Drop implementation.

When the reference types proposal is disabled, we don't allocate a GC heap from
the instance allocator, we instead create a `DisabledGcHeap`. Rather than
returning this to the instance allocator when we're done with it, which won't
even know what to do with it since the instance allocator didn't create the GC
heap, we simply rely on the `DisabledGcHeap`'s `Drop` implementation.
@fitzgen fitzgen requested a review from a team as a code owner August 28, 2024 19:03
@fitzgen fitzgen requested review from alexcrichton and removed request for a team August 28, 2024 19:03
.features()
.contains(wasmparser::WasmFeatures::REFERENCE_TYPES)
{
let (index, heap) = if engine.features().reference_types() {
Copy link
Member

Choose a reason for hiding this comment

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

While you're here mind handling #9162 here as well and renaming reference_types in this PR to gc_types instead?

@fitzgen fitzgen enabled auto-merge August 28, 2024 20:00
@fitzgen fitzgen added this pull request to the merge queue Aug 28, 2024
Merged via the queue into bytecodealliance:main with commit ccc21b2 Aug 28, 2024
37 checks passed
@fitzgen fitzgen deleted the dont-dealloc-disabled-gc-heap branch August 28, 2024 20:36
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