Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
An important aspect of programming concerns the need to allocate storage. Unfortunately, drivers don't have the luxury of making simple calls to malloc and free, or new and delete. Instead, care must be taken to ensure that memory of the right type is allocated. Drivers must also be sure to release any memory they allocate, since there is no automatic cleanup mechanism for kernel-mode code. This section describes techniques a driver can use to work with temporary storage.
There are three options for allocating temporary storage in a driver. The criteria used to select the right storage type depends on factors such as duration, size, and from what IRQL level the code which accesses it will be running. The available options are