Repository navigation
vm: unique non-Copy handle for trampoline frames - #8762
Conversation
run_trampoline takes &mut again; the loop holds TrampolineIFrame so two &mut InterpreterFrame cannot alias the same allocation. Assisted-by: Grok:4.6
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: RustPython/RustPython/.coderabbit.yml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe trampoline now uses non- ChangesTrampoline frame ownership
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Refactor Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 |
One of checkbox below must be checked.
Summary
Follow-up to #8737. The trampoline stores frames while it switches to a callee, then re-borrows them. That cannot stay as a live
&mut InterpreterFramefor the whole call, so the loop used raw*mut.This wraps the pointer in
TrampolineIFrame:Copy, so two handles cannot alias the same allocationas_mut(&mut self)so exclusive access goes through the handlerun_trampolinetakes&mut InterpreterFrameagain and converts at the door withfrom_mutfrom_ptrstaysunsafefor datastack callees and claimed generator framesPointer validity (datastack LIFO, generator
PyRef+ running claim) is still a construction contract. This only encodes “one&mutper frame at a time”.Assisted-by: Grok:4.6
Summary by CodeRabbit