Just a thought (and a too late thought), but instead of doing a custom code, we can just use AddressSanitizer poisoning and let the ASAN do it's job: https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning This would make the code simpler, more standard and allow us to use ASAN to work on the custom mempool.