Overriding operator delete in a Python extension

Andrew Wilkinson ajw140NO at SPAM.york.ac.uk
Sat Jan 17 11:30:38 EST 2004


Hi,

This is probably more of a gcc question than a python one, but hopefully
someone out their will know that answer.

I've written a C++ Python extension, and as part of it I override the
operator new and operator delete functions to provide memory leak tracking
from within the extension.

When I use the code as part of a complete C++ program everything works
perfectly, however when I compile it with my Python interface code the
operator delete function is not called - the operator new function is
called as normal however. I assume this is because the function is not
linked correctly, but I'm at a loss for how to make the linker resolve the
references in the .so file.

Does anyone know a possible solution to my problem?
Regards,
Andrew Wilkinson

-- 
University is a fountain of knowledge, and students go there to drink.





More information about the Python-list mailing list