Stream: git-wasmtime

Topic: wasmtime / PR #10401 Transitively dec-ref objects in the ...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2025 at 17:53):

fitzgen opened PR #10401 from fitzgen:drc-transitive-dec-ref to bytecodealliance:main:

Previously, the DRC collector only performed shallow reference counting where if an object's ref count was decremented and reached zero, then we would deallocate that object, but we would not decrement the reference counts of any other object that was referenced by it. This commit changes that, so that now we will decrement the reference counts of other objects referenced by an object that is being deallocated.

This requires some method of tracing an object's outgoing edges. To avoid needing to keep around and dispatch upon type-specific information about which struct fields are GC references, for example, we instead pack all GC references at the start of the object, just after its header. We additionally keep a count of how many GC references an object has in its header. This allows us to create a slice of any object's GC references, and we can uniformly trace any GC object's outgoing edges. We don't need to reflect on the GC object's actual type.

A final detail: the DRC collector was previously storing the object size in the common GC header's reserved bits. It now stores the number of GC refs there instead, and the object size is stored in its own field in the DRC-specific header, next to the ref count. This is nice because, since we are making the DRC header larger anyways, it raises the DRC collector's implementation limit on object size from u27::MAX to u32::MAX.

Fixes #9701

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2025 at 17:53):

fitzgen requested pchickey for a review on PR #10401.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2025 at 17:53):

fitzgen requested wasmtime-core-reviewers for a review on PR #10401.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2025 at 18:10):

pchickey submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2025 at 18:12):

fitzgen updated PR #10401.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2025 at 18:12):

fitzgen updated PR #10401.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2025 at 18:12):

fitzgen has enabled auto merge for PR #10401.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2025 at 18:20):

fitzgen updated PR #10401.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2025 at 19:44):

github-actions[bot] commented on PR #10401:

Subscribe to Label Action

cc @fitzgen

<details>
This issue or pull request has been labeled: "wasmtime:api", "wasmtime:ref-types"

Thus the following users have been cc'd because of the following labels:

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2025 at 20:59):

fitzgen updated PR #10401.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 17 2025 at 21:56):

fitzgen updated PR #10401.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 18 2025 at 00:25):

fitzgen updated PR #10401.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 18 2025 at 00:25):

fitzgen has enabled auto merge for PR #10401.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 18 2025 at 01:11):

fitzgen merged PR #10401.


Last updated: Apr 17 2025 at 00:13 UTC