Commit 3498771
committed
Makefile: build coreaudio3.m with -fobjc-arc
audio/drivers/coreaudio3.m is written assuming ARC:
- Uses __bridge / __bridge_retained / __bridge_transfer casts in
the coreaudio3_init / coreaudio3_write / coreaudio3_free hooks
to move an NSObject through the void* driver-interface without
the caller needing to know its real type.
- Zero manual [x retain] / [x release] / [x autorelease] calls
anywhere in the file.
- Assigns Obj-C locals to ivars ('_au = au') and relies on ARC's
strong-ivar semantics to retain them; dealloc has no matching
releases.
- Leaks every +1 local (renderFormat at line 253 / 268, the
dispatch_semaphore at line 218) under MRC because nothing
releases them.
The file was enabled by '--enable-coreaudio3' (off by default, per
qb/config.params.sh line 127), but when enabled the top-level qb
Makefile build compiled it without -fobjc-arc - since it was not
in the per-file override list at the top of this Makefile alongside
metal.o and mfi_joypad.o. Under MRC compilation the file silently
leaks every Obj-C object it creates, which in audio-driver code
means a steady accumulation with every driver reinit (device
hotplug, latency change, etc.). The __bridge* casts still
compile under MRC (they're ARC's ownership-casts but are also
valid non-ARC syntax), so the build succeeded and nothing
fired - the leaks were invisible until you ran Instruments.
No Xcode project references this file (grepped all of pkg/apple/*/
project.pbxproj - empty result), so the Xcode-side per-file
CLANG_ENABLE_OBJC_ARC=YES path doesn't exist for it yet. If that
integration ever lands, the Xcode target would also need to flip
it on.
Added coreaudio3.o to the ARC override list alongside metal.o and
mfi_joypad.o. Also updated the now-stale 'These three Objective-C
files' comment (it had said three but only listed two) and broadened
the ARC-constructs example from '__weak, etc.' to '__weak, __bridge*,
no manual retain/release' to cover this file's shape too.
Thread-safety: unchanged - this is a compile-flag change, no
runtime behaviour is touched. With ARC on, the existing ivar
assignments and bridge casts produce the intended retain counts;
the per-init-call leaks are reclaimed when the CoreAudio3
instance is released.
Reachability: anyone who enables --enable-coreaudio3. Default
builds are unaffected.1 parent 648558d commit 3498771
1 file changed
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
275 | 276 | | |
276 | 277 | | |
| 278 | + | |
277 | 279 | | |
278 | 280 | | |
279 | 281 | | |
| |||
0 commit comments