PDA

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



T2k
03-27-2001, 04: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 !)

Nutty
03-27-2001, 04: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.

Nutty

Deiussum
03-27-2001, 07: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.

n3r0nix
03-27-2001, 09: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.