fix(runtime): release compiled regex programs during GC - #9684
fix(runtime): release compiled regex programs during GC#9684proggeramlug wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughRegExp GC finalization now releases header-owned compiled programs for standard, fancy-regex, and RepeatMatcher implementations. The finalizer clears raw pointers and dead-header metadata. Tests verify release counts and prevent double release. ChangesRegExp GC cleanup
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to RegExp objects now release their compiled standard, fancy, and RepeatMatcher programs when collected, preventing retained program memory after their JavaScript owners die. The implementation includes coverage for release and repeated finalization, with no active merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 72.73% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 5 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Landed via merge train #9687 (rebase-merge, authorship preserved). Your test-plan boxes were unchecked so I validated independently, including a PERRY_GC_FORCE_EVACUATE=1 regex arm (96/0) to exercise the moved-stub path — the metadata-only stub handling and null-before-drop both hold up. |
Summary
Release the compiled regex programs owned by a
RegExpHeaderwhen the GC finalizes that header. This closes the permanent per-pattern leak reported in #9678.Changes
Arcreferences during true GC finalization.Related issue
Fixes #9678
Test plan
cargo build --releasecleancargo test --workspace --exclude perry-ui-ios --exclude perry-ui-tvos --exclude perry-ui-watchos --exclude perry-ui-gtk4 --exclude perry-ui-android --exclude perry-ui-windowspassesCARGO_BUILD_JOBS=1 RUST_TEST_THREADS=1 cargo test --lib -p perry-runtime(3,069 passed, 4 ignored)cargo test -p perry-runtime regex::tests::(60 passed)cargo test -p perry-runtime gc::tests::(930 passed, 1 ignored)cargo check -p perry-runtime --no-default-features./scripts/pre-tag-check.sh --quick#[test]in the affected crate./scripts/test_affected_crates.sh --base origin/maincompleted the entire single-threaded runtime phase successfully, then encountered an existing failure in the unchangedperrycrate:PERRY_CONCAT_SITE_CACHEis missing from the build-cache environment-variable inventory. The same focused test fails onorigin/main, and this branch has no diff undercrates/perry.Screenshots / output
Not applicable.
Checklist
feat:/fix:/docs:/chore:prefix convention used in the logSummary by CodeRabbit
Bug Fixes
Tests