https://github.com/fabio-d approved this pull request. Thanks @ChiaHungDuan and @cferris1000. This new revision solves my problem of tracking memory precisely even while it's being reallocated. https://github.com/llvm/llvm-project/pull/74353