CompuServe Messages

#Memory Allocation

    12-Sep-94 18:34:11
Sb: #123420-#Memory Allocation
Fm: Gus Grubba 70673,1605
To: Ken Mascaro, Xing T 70703,3505
I'm not sure why you care about GlobalAlloc and/or GlobalFree. The malloc() function isn't a standard "DOS" function. It's a standard C library function. Though there are other ways of messing around with memory, malloc is the "standard" way to allocate memory in any environment you use C. Windows has its own set of "kludgy" memory allocation functions as Windows itself is a kludge specially when it comes to memory. That's due to the way memory is layed out in the x86 plus all the different modes Windows has to deal with (or learned how to deal with along the way from real mode only, to 286 16Meg limit mode, and then to 32 bit flat memory mode). Bottom line, just go ahead and use malloc. Don't spend too much time with the PharLap library unless you need some specific interaction with the hardware and/or with the real mode running underneath. The only reason to allocate memory directly from PharLap would be if you wanted to have your own selector and your own set of protections. For that you would have to mess around with the 3D Studio configuration as all available memory gets allocated to it by default.