array of objects ?
> >>Call each objects destructor and then a dealloc for the whole array ?[/color] > > > > > > That’s right.[/color] > > But this is a hassle for me, since I then have to rember the size of > each array (the number of elements in there) or otherwise i would not be > able to delete it correctly. > > Looks like this will just increase my overhead and not give me any > significant speedups. > > My problem is, i’m doing billions (!) of new and delete (and copy ctors) > on small int arrays, which results in quie slow code.[/color] Perhaps you should have a look at the small object allocator that is part of the Loki library. I did some tests on it myself and found a significant speed up compared to the allocator that comes with my compiler. http://sourceforge.net/projects/loki-lib/ Also described in the book ‘Modern C++ Design’ by Andrei Alexandrescu. Well worth having. [color=blue] >[color=green][color=darkred] > >>Isn’t there a way to simply call some delete[] (mypool) my_array ?[/color] >