forked from softdevteam/bdwgc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide mechanism to track allocations with heap profiling tools
Tools such as Valgrind's massif[1] and KDE heaptrack[2] work by intercepting dynamically linked allocator calls so that they can do their own bookkeeping for tracking memory usage. While this enables them to trivially hook into any of the BDWGC calls which allocate, they aren't currently able to tell when the GC frees memory. This commit introduces a new function to the API, `GC_free_profiler_hook`, which is called for each object during the reclaim phase of the GC. It provides a stub for heap profiling tools to override so that they can see which objects were freed. This functionality is feature gated behind the `-DVALGRIND_TRACKING` flag. [1]: https://valgrind.org/docs/manual/ms-manual.html [2]: https://github.com/KDE/heaptrack
- Loading branch information
1 parent
0c88daa
commit 59d89a3
Showing
6 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters