Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resource leak in for loops #17246

Merged
merged 2 commits into from
Sep 17, 2014
Merged

Fix resource leak in for loops #17246

merged 2 commits into from
Sep 17, 2014

Conversation

bkoropoff
Copy link
Contributor

Trans the cleanup scope of for loop bindings so we don't leak resources. Regression test included.

Closes #17216

The cleanup scope of for loop bindings should translated when
popped to ensure resources are not leaked.
@bkoropoff
Copy link
Contributor Author

cc @pcwalton

@bkoropoff bkoropoff changed the title Fix #17216 Fix resource leak in for loops Sep 14, 2014
@retep998
Copy link
Member

Confirmed that memory usage improves from this PR

bors added a commit that referenced this pull request Sep 17, 2014
Trans the cleanup scope of for loop bindings so we don't leak resources.  Regression test included.

Closes #17216
@bors bors closed this Sep 17, 2014
@bors bors merged commit f1c4e47 into rust-lang:master Sep 17, 2014
@bkoropoff bkoropoff deleted the issue-17216 branch September 20, 2014 21:21
lnicola pushed a commit to lnicola/rust that referenced this pull request Jul 28, 2024
…eneration-to-server, r=Veykril

feature: teach rust-analyzer to discover `linked_projects`

This PR's been a long-time coming, but like the title says, it introduces server-side project discovery and removes the extension hooks I previously introduced. I don't think this PR is ready to land, but here are the things I'm feeling squishy about:
- I don't think I like the idea of introducing the `cargo-metadata` command-but-for-everything-else in the `flycheck` module, but the progress reporting infrastructure was too convenient to pass up. Happy to move it elsewhere.

Here are the things I _know_ I need to change:
- For progress reporting, I'm extracting from a `serde_json::Value` that corresponds to `tracing_subsciber::fmt::Layer`'s JSON output. I'd like to make this a bit more structured/documented than the current nonsense I wrote.
- The progress reporting currently hardcodes "Buck"; it should be deriving that from the previously mentioned more-structured-output.
- This doesn't handle *reloading* when a corresponding buildfile is changed. It should be doing that.

<details>
<summary>Anyway, here's a video of rust-analyzer discovering a Buck target.</summary>

https://github.com/rust-lang/rust-analyzer/assets/2067774/be6cd9b9-2c9a-402d-847f-05f860a91df1
</details>
lnicola pushed a commit to lnicola/rust that referenced this pull request Jul 28, 2024
…oject-notification, r=Veykril

chore: remove `UnindexinedProject` notification

This PR is split out from rust-lang/rust-analyzer#17246 (and contains its changes, which is a little annoying from a review perspective...). I'd like to land this change a week or so after rust-lang#17246 lands in order to give any users of the unindexed project notification time to adopt migrate.
RalfJung pushed a commit to RalfJung/rust that referenced this pull request Aug 1, 2024
…eneration-to-server, r=Veykril

feature: teach rust-analyzer to discover `linked_projects`

This PR's been a long-time coming, but like the title says, it introduces server-side project discovery and removes the extension hooks I previously introduced. I don't think this PR is ready to land, but here are the things I'm feeling squishy about:
- I don't think I like the idea of introducing the `cargo-metadata` command-but-for-everything-else in the `flycheck` module, but the progress reporting infrastructure was too convenient to pass up. Happy to move it elsewhere.

Here are the things I _know_ I need to change:
- For progress reporting, I'm extracting from a `serde_json::Value` that corresponds to `tracing_subsciber::fmt::Layer`'s JSON output. I'd like to make this a bit more structured/documented than the current nonsense I wrote.
- The progress reporting currently hardcodes "Buck"; it should be deriving that from the previously mentioned more-structured-output.
- This doesn't handle *reloading* when a corresponding buildfile is changed. It should be doing that.

<details>
<summary>Anyway, here's a video of rust-analyzer discovering a Buck target.</summary>

https://github.com/rust-lang/rust-analyzer/assets/2067774/be6cd9b9-2c9a-402d-847f-05f860a91df1
</details>
RalfJung pushed a commit to RalfJung/rust that referenced this pull request Aug 1, 2024
…oject-notification, r=Veykril

chore: remove `UnindexinedProject` notification

This PR is split out from rust-lang/rust-analyzer#17246 (and contains its changes, which is a little annoying from a review perspective...). I'd like to land this change a week or so after rust-lang#17246 lands in order to give any users of the unindexed project notification time to adopt migrate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

For loops leak resources
5 participants