I have a piece of code that does a lot of memory allocation.
I would like to know if there were a pattern that I can implement to reuse previously deleted memory (because I build a lot of temporary objects that allocate memory like int*
, char*
, etc.. but it can be very huge).
My purpose is optimization, so I'd like to reuse the memory and not "delete" it even when using temporary object.
It may not be clear enough, let me know so that I can post some code to show you the problem.