forked from dotnet/runtime
-
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.
Fix memory leak in enqueue/dequeue of EventPipe callback data.
dotnet#56104 made sure provider callback data gets its own copy of filter data. This created a couple of memory leaks when queue/dequeue the callback data since callback data was not correctly freed in these scenarios leading to leaks of the copied filter data. Was detected running the manual EventPipe native unit tests on Windows using its build in use of _CrtMemCheckpoint (only available in debug builds) automatically detecting memory leaks. Fix makes sure callback data is moved into queue on enqueue and moved out in dequeue and that caller of dequeue make sure to free returned callback data using ep_provider_callback_data_fini when done using it. Doing a move instead of copy will also reduce the number of allocations when enqueue/dequeue callback data in provider callback queue.
- Loading branch information
1 parent
8455a5e
commit 1ae4bf2
Showing
4 changed files
with
62 additions
and
18 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