rvolosatovs opened PR #14627 from rvolosatovs:fix/copy-gc-roots to bytecodealliance:main:
Table::copycopies each element by reading it withTable::getand writing it withTable::set. For GC reference tables,Table::getcreates a LIFORootedin the caller's current root scope. Nothing inTable::copyreleased those roots, so when it was called on a plain&mut Storerather than inside aRootScope, every copied object stayed rooted until the store was dropped. Repeated copies grew the root set and kept the GC heap from shrinking across collections.Enter a GC LIFO scope around each element's get/set pair and exit it afterwards, so the temporary root is released before the next element is copied.
rvolosatovs requested pchickey for a review on PR #14627.
rvolosatovs requested wasmtime-core-reviewers for a review on PR #14627.
rvolosatovs has enabled auto merge for PR #14627.
:thumbs_up: alexcrichton submitted PR review.
rvolosatovs added PR #14627 fix: don't leak GC roots in Table::copy to the merge queue
:check: rvolosatovs merged PR #14627.
rvolosatovs removed PR #14627 fix: don't leak GC roots in Table::copy from the merge queue
Last updated: Oct 11 2026 at 04:10 UTC