I wrote:
> One thing I noticed while reading the Valgrind manual is that
> they describe a facility for "two level" tracking of custom
> allocators such as ours.
And, since there's nothing new under the sun around here,
we already had a discussion about that back in 2021:
https://www.postgresql.org/message-id/flat/3471359.1615937770%40sss.pgh.pa.us
That thread seems to have led to fixing some specific bugs,
but we never committed any of the discussed valgrind infrastructure
improvements. I'll have a go at resurrecting that...
regards, tom lane