I've noticed that GlobalAlloc can acllocate Fixed or Movable Memory, code wise Fixed seem easier as theres no need to lock and unlock it. But what are the real differnces. For my program at the moment the allocated memory is in constant use, so which do of the two best suits. Thanks in advance Zadkiel.
Posted on 2001-07-02 18:35:00 by Zadkiel
The difference between "movable" and "fixed" memory is the thing of the past. It was very important during windows 1.0 or so when windows ran in real mode and Windows could not "move" memory blocks without breaking running programs. As you know, under win32, even if you specify "fixed" memory block, Windows can actually "move" the physical memory block elsewhere while your linear pointer is still valid.
Posted on 2001-07-02 19:16:00 by Iczelion
I think Microsoft considers both LocalAlloc and GlobalAlloc Obsolete and slow. Use HeapAlloc. According to Microsoft: in win32, memory blocks are never moved in physical memory. so even if you use movable memory blocks, the operating system wont take into consideration that fact, and you will not be gaining anything.
Posted on 2001-07-02 22:18:00 by Satrukaan
If I'm not mistaken, the "fixed" kind of memory block never gets paged out to disk, which might or might not be desirable.
Posted on 2001-07-03 05:15:00 by Larry Hammick