| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
The backend seems to continue to function after this. However, I'm not sure how you would like it tested. |
Sorry, something went wrong.
|
I'm not sure it is "testable"... Here is the traceback I was using to make it compatible if I enable ARC on main currently. This was in an effort to trace down the memory leaks. Here is the ARC recommendation: https://microsoft.github.io/objc-guide/MethodsAndImplementations/AutomaticReferenceCounting.html#convention expand for traceback src/_macosx.m:336:17: error: 'release' is unavailable: not available in automatic reference counting mode
[self->view release];
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/objc/NSObject.h:37:1: note: 'release' has been explicitly marked unavailable here
- (oneway void)release OBJC_ARC_UNAVAILABLE;
^
src/_macosx.m:336:17: error: ARC forbids explicit message send of 'release'
[self->view release];
~~~~~~~~~~ ^
src/_macosx.m:344:45: error: cast of Objective-C pointer type 'View *' to C pointer type 'void *' requires a bridged cast
(void*)self, (void*)(self->view));
^~~~~~~~~~~~~~~~~~~
src/_macosx.m:344:46: note: use __bridge to convert directly (no change in ownership)
(void*)self, (void*)(self->view));
^
__bridge
src/_macosx.m:344:52: note: use CFBridgingRetain call to make an ARC object available as a +1 'void *'
(void*)self, (void*)(self->view));
^
CFBridgingRetain
src/_macosx.m:548:17: error: 'release' is unavailable: not available in automatic reference counting mode
[window release];
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/objc/NSObject.h:37:1: note: 'release' has been explicitly marked unavailable here
- (oneway void)release OBJC_ARC_UNAVAILABLE;
^
src/_macosx.m:548:17: error: ARC forbids explicit message send of 'release'
[window release];
~~~~~~ ^
src/_macosx.m:601:46: error: cast of Objective-C pointer type 'Window *' to C pointer type 'void *' requires a bridged cast
(void*) self, (void*)(self->window));
^~~~~~~~~~~~~~~~~~~~~
src/_macosx.m:601:47: note: use __bridge to convert directly (no change in ownership)
(void*) self, (void*)(self->window));
^
__bridge
src/_macosx.m:601:53: note: use CFBridgingRetain call to make an ARC object available as a +1 'void *'
(void*) self, (void*)(self->window));
^
CFBridgingRetain
src/_macosx.m:651:81: error: ARC forbids explicit message send of 'autorelease'
NSImage* image = [[[NSImage alloc] initByReferencingFile: ns_icon_path] autorelease];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
src/_macosx.m:651:81: error: 'autorelease' is unavailable: not available in automatic reference counting mode
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/objc/NSObject.h:38:1: note: 'autorelease' has been explicitly marked unavailable here
- (instancetype)autorelease OBJC_ARC_UNAVAILABLE;
^
src/_macosx.m:682:60: error: ARC forbids explicit message send of 'autorelease'
encoding: NSUTF8StringEncoding] autorelease];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
src/_macosx.m:682:60: error: 'autorelease' is unavailable: not available in automatic reference counting mode
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/objc/NSObject.h:38:1: note: 'autorelease' has been explicitly marked unavailable here
- (instancetype)autorelease OBJC_ARC_UNAVAILABLE;
^
src/_macosx.m:769:67: error: must explicitly describe intended ownership of an object array parameter
- (void)installCallbacks:(SEL[7])actions forButtons:(NSButton*[7])buttons;
^
src/_macosx.m:795:67: error: must explicitly describe intended ownership of an object array parameter
- (void)installCallbacks:(SEL[7])actions forButtons:(NSButton*[7])buttons
^
src/_macosx.m:790:5: error: the result of a delegate init call must be immediately returned or assigned to 'self'
[self init];
^~~~~~~~~~~
src/_macosx.m:836:18: error: 'release' is unavailable: not available in automatic reference counting mode
[handler release];
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/objc/NSObject.h:37:1: note: 'release' has been explicitly marked unavailable here
- (oneway void)release OBJC_ARC_UNAVAILABLE;
^
src/_macosx.m:836:18: error: ARC forbids explicit message send of 'release'
[handler release];
~~~~~~~ ^
src/_macosx.m:928:21: error: 'release' is unavailable: not available in automatic reference counting mode
[buttons[i] release];
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/objc/NSObject.h:37:1: note: 'release' has been explicitly marked unavailable here
- (oneway void)release OBJC_ARC_UNAVAILABLE;
^
src/_macosx.m:928:21: error: ARC forbids explicit message send of 'release'
[buttons[i] release];
~~~~~~~~~~ ^
src/_macosx.m:929:16: error: 'release' is unavailable: not available in automatic reference counting mode
[image release];
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/objc/NSObject.h:37:1: note: 'release' has been explicitly marked unavailable here
- (oneway void)release OBJC_ARC_UNAVAILABLE;
^
src/_macosx.m:929:16: error: ARC forbids explicit message send of 'release'
[image release];
~~~~~ ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
error: command '/usr/bin/clang' failed with exit code 1
|
Sorry, something went wrong.
There was a problem hiding this comment.
I don't know anything about this, other than that this PR works on my machine and it doesn't appear to do anything malicious. Is there anyone else who ha sufficient macOS experience to vouch for this? Also is ARC sufficiently back compatible?
Sorry, something went wrong.
It came in MacOSX 10.7, so it has been around for quite a while now. Note that I did put a check at the top of the file as well so this will throw an error during compile if ARC is not enabled. |
Sorry, something went wrong.
|
marking as merge w/ one review unless another Mac user wants to review I will merge in a week or so... |
Sorry, something went wrong.
| return sharedWindowServerConnectionManager; | ||
| } | ||
|
|
||
| + (id)allocWithZone:(NSZone *)zone |
There was a problem hiding this comment.
https://developer.apple.com/documentation/objectivec/nsobject/1571945-allocwithzone
Do not override allocWithZone: to include any initialization code. Instead, class-specific versions of init... methods.
OK, good thing we are deleting it?
Sorry, something went wrong.
There was a problem hiding this comment.
it is also not clear we used this as the actual call site just above uses [[super allocWithZone:Null] init] ?
Sorry, something went wrong.
There was a problem hiding this comment.
This all came in via 7bacdc5 with the commit message
This patch allows interrupts to be delivered once Python is fixed.
Sorry, something went wrong.
This updates the objective C macosx backend to use automatic reference counting instead of relying on manual tracking and releasing of the memory.
|
I took the liberty of rebasing and removing the line that was breaking the wheel build. |
Sorry, something went wrong.
There was a problem hiding this comment.
Please merge this @greglucas if you are happy with the commit I added.
Sorry, something went wrong.
|
Yes, that commit looks good, it must have come in since the last rebase. Thanks for fixing it! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
This updates the objective C macosx backend to use automatic reference counting instead of relying on manual tracking and releasing of the memory. It seems like this is recommended now, but I am definitely not an expert in this.
PR Checklist
Tests and Styling
Documentation