View Full Version : "HeapAlloc/HeapReAlloc" or "malloc/new/alloc"

03-27-2001, 03:00 AM
which functions in "subject" should i use, when my data is quite often resized, is there a performance benifit for some of these functions ? (no AGP mem usage !)

03-27-2001, 03:06 AM
er.. haven't had 1st hand experience with all them functions, but they probably all do the same thing.

I would say redesign your algorithm and/or data, so you dont need to resize arrays often, or preferably not at all.


03-27-2001, 06:12 AM
If you are resizing your array constantly, you might want to consider using a linked list instead. This might not work well if you are using the array for something like OpenGL vertex arrays, though. Another thing you could use is the STL vector container.

03-27-2001, 08:12 AM
I find that STL is the best way of doing this but there is a noticeable performance hit.
I only use STL for initialization purposes (i.e. an array which contains what displaymodes are available, etc)
BTW in c++, realloc and malloc shouldn't be used.