delete-overload

delete overload, recursive overflow

Hey guys i wrote a quick test. I want delete to call deleteMe which will then delete itself. The purpose of this is so i can delete obj normally which are allocated by a lib. (i dont want any crashes due to crt or w/e). With delete this i get a stackoverflow, without it msvc says i leaked 4 bytes. When i dont call test i leak 0. How do ...

overloading delete, pure virtual func call

So i want to overload delete of a abstract virtual class. This will call deleteMe() in the derived class which is in another lib. This is to prevent error/crashes mention here http://stackoverflow.com/questions/443147/c-mix-new-delete-between-libs when i call delete me from delete in my base class, i get the error "pure virtual func cal...

Overloading global operator new/delete in C++

I am trying to overload the global operator new and delete for a performance sensitive application. I have read the concerns described at http://www.informit.com/articles/article.aspx?p=30642&seqNum=3 and the recommendations to use Intel TBB's allocator http://www.intel.com/technology/itj/2007/v11i4/5-foundations/5-memory.htm Since...

How do I override delete() on a model and have it still work with related deletes

class Widget(models.Model): title = models.CharField(max_length=255) class WidgetFile(models.Model): widget = models.ForeignKey(Widget) def delete(): # do some custom hard drive file vodo super(WidgetFile, self).delete() ... some code to create a Widget and a WidgetFile to go with it ... some_widget_instan...

overloading operator delete, or how to kill a cat?

I am experimenting with overloading operator delete, so that I can return a plain pointer to those who don't wish to work with smart pointers, and yet be able to control when the object is deleted. I define a class Cat that is constructed with several souls, has an overloaded operator delete that does nothing, and destructor that decrem...

Difference between operator new and operator new[]?

I've overloaded the global operator new/delete/new[]/delete[] but simple tests show that while my versions of new and delete are being called correctly, doing simple array allocations and deletes with new[] and delete[] causes the implementations in newaop.cpp and delete2.cpp to be called. For example, this code int* a = new int[10]; ...

Overloading Delete Operator in c++

In my code, i have overloaded the new and delete operators to get filename and line number. In my code I am using map and stack. When i do erase a particular value from the map it just call my overloaded delete function but I want only explicit delete statements to be able to access my function, not others. How can I do that? ...