Hi,
I was wondering if there is an easy way to keep track of all allocations
issued by instances of a specific class and its subclasses (i.e. keep track
of memory consumption of the class instances, including e.g. heap-allocated
member variables).
A global overloading of new / delete operators is out of question, because
I have to track memory consumption for a specific class, and also because
the base class implementation will be dynamically linked.
I had no luck overriding the member operator new either, because while it
is called to allocate the class instance itself, allocations within the
instance cannot be tracked that way. Maybe via a friend declaration?
Ideally, this should work as transparently as possible, i.e. no placement
operator new or other syntax differences.
Thanks for your input!
Manuel