Repository navigation
Migrate remaining macOS AutoCloseable call sites - #3293
Conversation
Eliminate releaseCFObjects helper in IOKit.java by wrapping raw MemorySegments as CFTypeRef in try-with-resources. Additional migrations: - IOReportClientFFM.create() and sampleGpuTicks() - MacDisplayFFM (restructured loop with separate childEntry) - MacPowerSourceFFM (keys created upfront, nested try-with-resources) - MacUsbDeviceFFM (multi-resource try-with-resources) - MacNetworkParamsFFM (NativeHandle for freeaddrinfo)
|
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 (6)
📜 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). (9)
🔇 Additional comments (6)
📝 WalkthroughWalkthroughThis PR refactors macOS FFM driver classes to adopt Java try-with-resources for resource lifecycle management, replacing manual ChangesmacOS FFM Try-With-Resources Lifecycle Management
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 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
❌ Your patch check has failed because the patch coverage (13.33%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #3293 +/- ##
============================================
- Coverage 75.64% 75.63% -0.01%
Complexity 76 76
============================================
Files 410 410
Lines 15810 15807 -3
Branches 2528 2529 +1
============================================
- Hits 11959 11956 -3
- Misses 2382 2385 +3
+ Partials 1469 1466 -3
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:
|
Continue the AutoCloseable migration for macOS FFM classes. Eliminates the
releaseCFObjectshelper entirely and migrates additional call sites.Changes
releaseCFObjectsusages withCFTypeReftry-with-resources; delete the now-unused helper methodcreate()andsampleGpuTicks()to try-with-resourcestry (serviceIterator; cfEdid), innertry (IORegistryEntry current), separatechildEntryvariable for conditional releasepowerSourcesInfoandcfListtry (iter; locationIDKey; ioPropertyMatchKey)NativeHandleforfreeaddrinfoIntentionally left
MacHWDiskStoreFFM/MacFileSystemFFM— queued for a dedicated follow-up PRMacSensorsFFM/MacGpuStatsFFM—smcClose(int)not a MemorySegment handleMacCentralProcessorFFM—vm_deallocate(raw memory, not CF/IOKit)IOReportClientFFM(4 remaining) — stateful cross-call sample lifecycleWhoFFM—endutxent()no-arg cleanup, not a handleSummary by CodeRabbit