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

Create a LoggingAllocator class #669

Open
timsneath opened this issue Mar 1, 2023 · 2 comments
Open

Create a LoggingAllocator class #669

timsneath opened this issue Mar 1, 2023 · 2 comments
Labels
enhancement New feature or request quality Truly polished experience

Comments

@timsneath
Copy link
Contributor

A logging allocator class would behave as follows:

  • For release builds, it would simply wrap the existing calloc / free model with no significant overhead
  • For debug builds, it would track the number and size of allocations it had made, along with as much metadata as can be captured on the source of the allocation. On freeing memory, it would remove the equivalent entry from the tracking log. At any time, it should be possible to retrieve the log.

The logging allocator would help detect memory leaks during test runs, by validating that all memory allocated had been freed by the end of the run.

Idea inspired by @dcharkes.

@timsneath timsneath added the quality Truly polished experience label Mar 1, 2023
@halildurmus
Copy link
Member

halildurmus commented Mar 1, 2023

Yes please!

@timsneath
Copy link
Contributor Author

Potential solution: dart-lang/leak_tracker#42

@halildurmus halildurmus added the enhancement New feature or request label Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request quality Truly polished experience
Projects
None yet
Development

No branches or pull requests

2 participants