Chapter Six. A History of the GlobalAlloc Function

THE GLOBALALLOC FUNCTION was once the center of Windows memory allocation. Everything came from GlobalAlloc, be it code or data, private application data, or shared clipboard data. In this chapter, we follow the history of this function (as well as its close friend GlobalLock) from its salad days as the king of the heap to its current position of faded glory in Win32. And as you’ll see, many of the strange requirements regarding the use of memory allocated on the global heap date back to the days when the global heap behaved very differently from how it does today.

The early years

ONCE UPON A time, there was Windows 1.0. This was truly the Before Time. 640K. Segments. Near and far pointers. No ...

Get The Old New Thing: Practical Development Throughout the Evolution of Windows now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.