Repository navigation
Migrate nested handle patterns to NativeHandle (Windows + Linux) - #3291
Conversation
Replace manual try/finally blocks with NativeHandle try-with-resources for nested native handle lifecycle management. Linux (udev): - LinuxCentralProcessorFFM (3 methods) - LinuxHWDiskStoreFFM - LinuxLogicalVolumeGroupFFM - LinuxNetworkIFFFM - LinuxPowerSourceFFM - LinuxUsbDeviceFFM Windows: - WindowsBluetoothDeviceFFM (radio + device find handles) - WindowsDisplayFFM (SetupDi + registry key handles) - WindowsPowerSourceFFM (SetupDi + battery handles) - WindowsOSProcessFFM (process + token handles)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
🧰 Additional context used🧠 Learnings (5)📚 Learning: 2026-04-14T23:28:14.505ZApplied to files:
📚 Learning: 2026-04-15T04:56:15.707ZApplied to files:
📚 Learning: 2026-04-18T23:21:41.153ZApplied to files:
📚 Learning: 2026-04-05T15:37:16.042ZApplied to files:
📚 Learning: 2026-04-08T00:58:07.212ZApplied to files:
🔇 Additional comments (11)
📝 WalkthroughWalkthroughThis PR refactors native resource management across multiple Linux and Windows FFM (Foreign Function Memory) classes to consistently use ChangesNative Handle Lifecycle Management Refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3291 +/- ##
============================================
- Coverage 75.68% 75.60% -0.08%
Complexity 76 76
============================================
Files 410 410
Lines 15814 15812 -2
Branches 2518 2524 +6
============================================
- Hits 11969 11955 -14
- Misses 2379 2386 +7
- Partials 1466 1471 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Replace manual
try/finallyblocks withNativeHandletry-with-resources for nested native handle lifecycle management. This is PR 2 of 3 in the NativeHandle migration series (#3290 introduced the class).Linux (udev handles)
LinuxCentralProcessorFFM(3 methods: topology, current freq, max freq)LinuxHWDiskStoreFFMLinuxLogicalVolumeGroupFFMLinuxNetworkIFFFMLinuxPowerSourceFFMLinuxUsbDeviceFFMWindows
WindowsBluetoothDeviceFFM(radio find + device find handles)WindowsDisplayFFM(SetupDi + registry key handles; extractedqueryEdidFromKeyhelper)WindowsPowerSourceFFM(SetupDi + battery handles)WindowsOSProcessFFM(process + token handles)Summary
finallyblocks replaced withNativeHandletry-with-resourcesIOObject/CFTypeRef→AutoCloseable)Summary by CodeRabbit
Refactor
Chores