Summary
Windows memory management includes the following features.
- Logic can be simplified by allowing the Windows heap management and exception handlers to detect and process allocation errors.
- Multiple independent heaps provide several advantages over allocation from a single heap.
- Memory-mapped files, available with UNIX but not with the C library, allow files to be processed in memory, as illustrated by several examples. File mapping is independent of heap management, and it can simplify many programming tasks. Appendix C shows the performance advantage of using memory-mapped files.
- DLLs are an essential special case of mapped files, and DLLs can be loaded either explicitly or implicitly. DLLs used by numerous applications should provide version information.
Looking Ahead
This completes coverage of what can be achieved within a single process. The next step is to learn how to manage concurrent processing, first with processes (Chapter 6) and then with threads (Chapter 7). Subsequent chapters will show how to synchronize and communicate between concurrent processing activities.
Additional Reading
Memory Mapping, Virtual Memory, and Page Faults
David Solomon and Mark Russinovich, in Inside Windows 2000, describe the important concepts, and most OS texts provide good in-depth discussion.
Data Structures and Algorithms
Search trees and sort algorithms are explained in numerous texts, including the books by Thomas A. Standish and Robert Sedgewick.
Using Explicit Linking
DLLs and explicit linking are fundamental to the operation of COM, which is widely used in Windows software development. Chapter 1 of Don Box's Essential COM shows the importance of LoadLibrary and GetProcAddress.