Repository navigation
Bridge CFRunLoop to NSRunLoop mode methods - #167
Merged
Merged
Conversation
triplef
referenced
this pull request
in gnustep/libs-base
Oct 23, 2026
triplef
marked this pull request as ready for review
October 23, 2026 06:13
CFRunLoopAddCommonMode(), CFRunLoopCopyAllModes() and CFRunLoopCopyCurrentMode() now dispatch to the corresponding NSRunLoop methods when passed an Objective-C object. A new NSCFRunLoop bridge class implements those methods for CFRunLoopRefs, so the functions of the same names in GNUstep Base work on them too. Also fixes the count of classes required before bridging is initialized, which was not updated when NSCFDate was added.
triplef
force-pushed
the
bridge-cfrunloop
branch
from
October 23, 2026 06:59
756733c to
6b67c72
Compare
Member
Author
|
The gnustep-1.9 tests were failing because autoreleasing any bridged CF object seems to crash on gnustep-1.9. The minimal reproduction is |
Contributor
|
OK. Thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to gnustep/libs-base@4fae78775, which implemented
CFRunLoopAddCommonMode(),CFRunLoopCopyAllModes()andCFRunLoopCopyCurrentMode()in Base. With this change, both libraries export these functions with equivalent behavior, so it doesn't matter which library's copy a caller binds to:NSRunLoopfrom-getCFRunLoop), they dispatch to the corresponding NSRunLoop methods viaCF_OBJC_FUNCDISPATCHV, like the CFRunLoopTimer functions already do. Without the ObjC runtime they keep only the native path.NSCFRunLoopbridge class: implements-addCommonMode:,-allModesand-currentModefor CFRunLoopRefs, so Base's functions (which send those messages) work on corebase run loops too. It calls private implementations rather than the public functions, because those could resolve to Base's copy and recurse.NSCFType.m: fixesrequiredClasses, which was not updated whenNSCFDatewas added (13 classes callNSCFInitialize(), but the count was 12). It is now 14, including the new class.Testing
Tested on Windows (MSVC ABI, clang, libobjc2) with the new
Tests/CFRunLoop/bridge.m:Not yet tested: the NSCFRunLoop path (Base's functions on a corebase run loop). CFRunLoop support is disabled on Windows, so
CFRunLoopGetCurrent()returns NULL there, and the test marks that part as hopeful. Draft until it has run on Linux.