allocation huge amounts of memory...

what is the best way of allocating huge amounts (5mb and more) of memory (for storing modeldata, bitmaps …)

presently im using the window api call
HeapCreate
to create a new heapobject of the desired size. (but it feels a little strange always to use HeapAlloc to get memory from this heap)

is there any other way to get memory without creating a new heap (malloc doesnt provide enough mem…)

if you are using c++ you could try the “new” command

What are you allocating? Just a bunch of bytes? If you use C++'s new operator like this…

unsigned char * buf = new unsigned char[SZ];

…make sure you release it like this:

delete [] buf; // Don’t forget the []

Another note. Always prefer standard C++ constructs, operators, classes, etc. to Windows or operating specific alternatives. If you ever have to port your code to another platform, it will go much easier.

i also tried using new, but i didnt get enough memory (after some models were loaded i wasnt able to allocate more…).
with heapalloc this works… well i guess i have to stick to it thx for the answers