-
Notifications
You must be signed in to change notification settings - Fork 6k
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -118,7 +120,7 @@ | |||
return false; | |||
} | |||
|
|||
layer_.get().contents = reinterpret_cast<id>(static_cast<CGImageRef>(pixmap_image)); | |||
layer_.get().contents = (__bridge id)(static_cast<CGImageRef>(pixmap_image)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we remove the scoped_nsobject from layer_
?
But it's also fine to defer that to a second-pass cleanup when you eliminate scoped_nsobject
completely if you'd rather.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do a cleanup sweep at the end. I'll keep removing them where it's easy though.
auto label is removed for flutter/engine/52139, due to - The status or check suite Mac mac_host_engine has failed. Please fix the issues identified (or deflake) before re-applying this label. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😨
@gaaclarke I'm not following your comments here; why would we need special annotations when a function that doesn't use magic words (e.g., |
|
What |
I'm talking about |
Okay, so that's the same basic question as #52226 (comment) |
This was resolved to be okay. There is conditional compilation that switches the behavior based on arc or mrc, at the scoped_nsprotocol level.
This was shown that the default behavior is returning autoreleased objects so should be good. I thought they were returning retained objects and the call site would release them. I think that may be an optimization that arc can do, but if it doesn't know the call site it can't.
This is still a thing since we are now adding extra autorelease pool entries where there were none. I'm not sure how heavily this code is used but my professional opinon would be to not add the entries to the autorelease pool and to maintain the old semantics. This can be observed compiling @interface Foo : NSObject
@end
@implementation Foo
@end
class Bar {
public:
Foo *GetFoo() { return foo_; }
private:
Foo *foo_;
}; generates __ZN3Bar6GetFooEv: ; @_ZN3Bar6GetFooEv
.cfi_startproc
; %bb.0:
sub sp, sp, #16
.cfi_def_cfa_offset 16
str x0, [sp, #8]
ldr x8, [sp, #8]
ldr x0, [x8]
add sp, sp, #16
b _objc_retainAutoreleaseReturnValue
.cfi_endproc
|
Returning an unretained object without autoreleasing it is generally an anti-pattern, as it can lead to subtle crash bugs. I would strongly recommend that we follow standard advice relating to optimization: follow standard behaviors until/unless there's clear evidence that a particular piece of code is critical to overall performance, rather than trying to manual pre-optimize just in case. |
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
test-exempt: code refactor with no semantic change |
…147336) flutter/engine@b5d5832...b30c0a7 2024-04-24 [email protected] Remove UIAccessibilityTraitKeyboardKey to fix touch typing (flutter/engine#52333) 2024-04-24 [email protected] [Impeller] Remove libtess2 from libflutter. (flutter/engine#52357) 2024-04-24 [email protected] Roll Skia from 510b6766d907 to afcc1db27593 (2 revisions) (flutter/engine#52367) 2024-04-24 [email protected] [web:tests] switch to new HTML DOM matcher (flutter/engine#52354) 2024-04-24 [email protected] [Impeller] use spec constant for gaussian shader, rename, and reuse vertex sources. (flutter/engine#52361) 2024-04-24 [email protected] [Impeller] delete points compute shader. (flutter/engine#52346) 2024-04-24 [email protected] [darwin] Update pixel format handling in FlutterTexture (flutter/engine#52326) 2024-04-24 [email protected] [Impeller] make drawAtlas always use porterduff or vertices_uber shader (flutter/engine#52348) 2024-04-24 [email protected] Migrate ios_surface files to ARC (flutter/engine#52139) 2024-04-24 [email protected] Roll Dart SDK from f470eaaf6e6d to 38c43a01a51e (1 revision) (flutter/engine#52365) 2024-04-24 [email protected] Roll Skia from b5dd23bd29df to 510b6766d907 (16 revisions) (flutter/engine#52364) 2024-04-24 [email protected] Fix some warnings reported by recent versions of clang-tidy (flutter/engine#52349) 2024-04-24 [email protected] Roll Skia from e15464e6e982 to b5dd23bd29df (1 revision) (flutter/engine#52353) 2024-04-24 [email protected] Roll Dart SDK from 5227dc5103f6 to f470eaaf6e6d (1 revision) (flutter/engine#52359) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Smart pointers support ARC as of #47612, and the unit tests were migrated in #48162.
Migrate
ios_surface
classes from MRC to ARC.Decorate C functions that take or return Objective-C objects or structs containing Objective-C objects with
cf_audited_transfer
.Part of flutter/flutter#137801.