https://developers.redhat.com/articles/2022/03/23/use-valgri...
The comment itself is AI generated or the code reference?
Here's some of my old code
https://github.com/php/pecl-caching-apc/blob/0dd2a69bab58822...
https://github.com/google/sanitizers/wiki/addresssanitizer
I believe to integrate a custom allocator with ASAN, you need to look at the memory "poisoning" mechanisms:
https://github.com/google/sanitizers/wiki/AddressSanitizerMa...
https://learn.microsoft.com/en-us/cpp/sanitizers/asan?view=m...
.NET team also makes use of it for the runtime parts,
https://devblogs.microsoft.com/cppblog/msvc-address-sanitize...
[1] https://github.com/google/sanitizers/wiki/AddressSanitizerMa...
It's not always the case that you want special behavior for the garbage collector to assist with debugging, but also this: if you want to use Valgrind to debug anything that does not have to do with the garbage collector, you want all the false positives generated by it out of your way.
Some of the scanning that a conservative garbage collector has to do looks like access errors to Valgrind. By using the Valgrind API, you can grant yourself access to that memory, and then lock it again when done.
That aspect doesn't necessarily apply to a pool allocator being described in this article; that should not be triggering any false positives.
> I integrated the TXR Lisp garbage collector with valgrind.
That's funny, because when I said "for other projects I am working on", I specifically meant a Lisp interpreter which uses a memory pool and garbage collection (I am still working on implementing this last part, anyway). I am very happy about the fact that I can continue using valgrind in this project.