Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Impeller] Use NSAutoReleasePool for Metal playgrounds. #40748

Merged
merged 2 commits into from
Mar 29, 2023

Conversation

dnfield
Copy link
Contributor

@dnfield dnfield commented Mar 29, 2023

Fixes flutter/flutter#117339

I judged this better than having a separate ObjC++ implementation for macOS playgrounds.

Fixes flutter/flutter#117339

Avoids creating a new parallel ObjC++ TU
@dnfield dnfield requested review from chinmaygarde and bdero March 29, 2023 03:43
@flutter-dashboard
Copy link

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 Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on 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.

@chinmaygarde chinmaygarde changed the title Use NSAutoReleasePool for Metal playgrounds [Impeller] Use NSAutoReleasePool for Metal playgrounds. Mar 29, 2023
Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, makes sense! Could this also explain the leak of the command buffers? The buffers hold onto resources and that could explain the massive leaks. Perhaps we can back out that commit now.

I also see a scoped NSObject for autorelease pools in fml. But the implementation is missing and the comment mentions a missing alternative. In a separate patch, we should clean that up move these utilities to FML.

Either way, lgtm. This is a massive improvement to the playgrounds experience.

Copy link
Member

@bdero bdero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dnfield
Copy link
Contributor Author

dnfield commented Mar 29, 2023

The command buffer leak is a separate issue - applying this patch doesn't seem to help it (they're actual leaks, whereas this is just flushing the autorelease pool on each turn of the loop)

@dnfield dnfield added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 29, 2023
@auto-submit auto-submit bot merged commit 0b4286c into main Mar 29, 2023
@auto-submit auto-submit bot deleted the dnfield-patch-2 branch March 29, 2023 05:35
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App e: impeller needs tests
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Impeller] Are Metal playgrounds leaking memory?
3 participants