rework weakref#6916
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughThis pull request refactors the weakref locking mechanism in the VM from per-object mutex guards to a stripe-based locking approach, inlines the weakref list representation, and adds a direct referent pointer to Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
Code has been automatically formatted The code in this PR has been formatted using:
git pull origin weakref |
Remove heap-allocated WeakListInner (OncePtr<PyMutex<WeakListInner>>). WeakRefList now holds two inline atomic pointers (head, generic). PyWeak.parent replaced with wr_object pointing directly to referent. Add weakref_lock module with AtomicU8 spinlock array for thread safety. Rewrite upgrade/clear/drop_inner/count/get_weak_references with stripe lock. Make Pointers methods public in linked_list.rs. Remove expectedFailure from test_subclass_refs_dont_replace_standard_refs.
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [x] lib: cpython/Lib/weakref.py dependencies:
dependent tests: (147 tests)
Legend:
|
Summary by CodeRabbit
Refactor
Chores
✏️ Tip: You can customize this high-level summary in your review settings.