I created my own memory manager by overloading the new and delete operators of my base class. The overloaded operators maintain a linked list of memory allocations and I also store the file and line number of the allocation. It works with multiple inheritance as well, since the delete operator always receives the correct memory address (i.e. the address I returned from 'new'). What is the best way for me to get the memory address of the object (i.e. the memory address of the first parent)?
I want to create methods that, at run-time, can return the allocation file and line number. With multiple inheritance the 'this' pointer might not point to the correct memory address (it is sometimes offset by 8 bytes). I understand why it is offset, but I'm looking for a way to reliable calculate the correct memory address originally returned by the new operator.