Closed davidchisnall closed 4 years ago
I have a patch for this, but was delayed in submitting it due to other incompatibilities with 1.9. It does simplify our code quite a bit!
From: David Chisnall notifications@github.com Sent: Thursday, August 9, 2018 6:31 AM To: Microsoft/WinObjC Cc: Subscribed Subject: [Microsoft/WinObjC] NSObject almost reimplements the runtime's refcounting (#2885)
The refcount manipulations in NSObject are exposing some implementation details that may change. The simplest way of supporting -_ARCCompliantRetainRelease is to just call objc_retain, objc_release and so on from the -retain, -release and so on methods. Please call object_getRetainCount_np to implement -retainCount. The current version will not work well with the runtime's weakref fast paths and will return an incorrect value if an object has had a weak reference taken, if used with the 1.9 or 2.0 branches of the runtime.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2FWinObjC%2Fissues%2F2885&data=02%7C01%7Cduhowett%40microsoft.com%7Cad2d4c47374f42bda4e908d5fdfc6994%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636694182903319717&sdata=LAEbNd6XLxA90yPPd3pAxsFiou250fA9QsJDDoWYLRU%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FANp1mnSWcIcNx0uKGCUgsayCJOCrPWrDks5uPDmvgaJpZM4V1sGt&data=02%7C01%7Cduhowett%40microsoft.com%7Cad2d4c47374f42bda4e908d5fdfc6994%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636694182903319717&sdata=DlmL%2BqWp5oGM%2FNZbhJbganZZVoaRN1mSo2fSCkV4nFA%3D&reserved=0.
(#2886)
The refcount manipulations in NSObject are exposing some implementation details that may change. The simplest way of supporting
-_ARCCompliantRetainRelease
is to just callobjc_retain
,objc_release
and so on from the-retain
,-release
and so on methods. Please callobject_getRetainCount_np
to implement-retainCount
. The current version will not work well with the runtime's weakref fast paths and will return an incorrect value if an object has had a weak reference taken, if used with the 1.9 or 2.0 branches of the runtime.