A
Alexander Adam
Hi!
I've got a pretty complex data structure that keeps instances of
structs allocated with the new operator.
Now my issue is that those structures are required to be allocated /
deallocated pretty often resulting
in a huge perfomance issue. Usually what I am doing is to create
arrays and initialize their sizes a few
times bigger than originally required to avoid another allocation on
the next run. Then I do simply reset them
and do a memcpy at the existing location. This works great with POD
structus but my structs are complex
in the way that they not only use inheritance but they do also use
internal objects that do require an
constructor / destructor. So what is the general way to handle such
things? Am I missing something?
thanks!
Alex
I've got a pretty complex data structure that keeps instances of
structs allocated with the new operator.
Now my issue is that those structures are required to be allocated /
deallocated pretty often resulting
in a huge perfomance issue. Usually what I am doing is to create
arrays and initialize their sizes a few
times bigger than originally required to avoid another allocation on
the next run. Then I do simply reset them
and do a memcpy at the existing location. This works great with POD
structus but my structs are complex
in the way that they not only use inheritance but they do also use
internal objects that do require an
constructor / destructor. So what is the general way to handle such
things? Am I missing something?
thanks!
Alex