-
-
Notifications
You must be signed in to change notification settings - Fork 220
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
Simple memory leak detector for -O0
code or unit test mode
#1809
Comments
What do you think about |
And of course the tracking heap allocator. |
That's cool. Also But these tools require special flags or developer efforts to enable them. I'm proposing to have lightweight and unintrusive rough checks for debug builds (or maybe on tests) enabled by default. Emitting just one warning message about possible leaks. |
Tracking allocations (necessary for leak detection) is a bit overkill for debug builds, however it could certainly be implemented (easily!) for tests by simply using the Tracking Allocator for running tests. |
The |
It would be great to have very simple memory leak check in allocators when doing debug builds. It simply tracks a number of allocs and number of frees via simple global variable counter.
In a warning message, c3c may advise compiling and run with
--sanitize=address
to find out exact place of memory leak.I have similar in C:
The text was updated successfully, but these errors were encountered: