MmFreeContiguousMemory

VOID
    MmFreeContiguousMemory(

        IN PVOID  BaseAddress
        );

MmFreeContiguousMemory releases a range of physically contiguous memory that was allocated with MmAllocateContiguousMemory.

Parameters

BaseAddress
Points to the virtual address of the memory to be freed.

Comments

This routine is the reciprocal of MmAllocateContiguousMemory, and is usually called only when a driver is being unloaded. The input BaseAddress must have been returned by a preceding call to MmAllocateContiguousMemory.

A device driver that must use contiguous memory should allocate only what it needs during driver initialization because nonpaged pool is likely to become fragmented as the system runs. Such a driver must deallocate the memory if it is unloaded.

Callers of MmFreeContiguousMemory must be running at IRQL = PASSIVE_LEVEL.

See Also

MmAllocateContiguousMemory