View Full Version : "HeapAlloc/HeapReAlloc" or "malloc/new/alloc"
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, 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.
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.
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.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.