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
Improve memory tracking #1631
Improve memory tracking #1631
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think counter needs to be atomic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
This PR makes it so you can call mgp_track_current_thread_allocations on the same thread&transaction multiple times. This is needed when you want to track memory on newly created threads but are using a library such as omp.h for parallelisation. The problem is you don't know are you currently on the main thread (which is already being tracked) or a newly created thread. Attempting to untrack the same thread&transaction twice will result in a crash
Since our skiplist doesn't allow for duplicates a new struct was created which has a counter.
[master < Epic] PR
[master < Task] PR
To keep docs changelog up to date, one more thing to do: