I feel like this has to be a feature, but my Google-Fu has failed me. I apologize in advance if this has been asked/answered before, it feels so obvious, but I couldn't find anything.
Is there a means to mark an allocation as deliberately leaking? The context is a data structure that is dynamically allocated once during program init and used throughout the program lifetime. There's no real reason to free all of the allocated objects just before program termination (why clean up the room when there's a wrecking ball headed for the whole house?), but it results in a lot of false-positives from valgrind.
I am aware that I could create a suppression file, but that feels manual and disconnected. I would much prefer some kind of macro or other in-source annotation that this allocation is intentionally never freed (e.g. something akin to malloc(...)
-> malloc_IGNORE_LEAK(...)
). Does valgrind support this in some way?
If it doesn't, what it the preferred solution for marking / tracking deliberate "leaks"?