XMemSetAllocationHysteresis

Sets the hysteresis amount for a given heap, rounded up to an internal allocation boundary (4 MB).

Syntax

BOOL XMemSetAllocationHysteresis(
         DWORD dwMemType,
         BOOL bLargeHeap,
         SIZE_T dwSize
)  

Parameters

dwMemType
Type: DWORD 

[in] Refers to the XALLOC_MEMTYPE_GRAPHICS constant describing the heap.

bLargeHeap
Type: BOOL 

[in] True if the heap is “large”; where “large” heaps are used to satisfy allocations that are 4 KB to 128 KB, or whose alignment is specified as 4 KB or higher; and “small” heaps are used to satisfy allocations that are smaller than 4 KB and whose alignment is specified as less than 4 KB.

dwSize
Type: SIZE_T 

[in] The amount of hysteresis (that is, the minimum amount of free memory that will be retained by the heap before additional free memory is returned to the operating system), in bytes. The heap implementation may round up the specified hysteresis amount to an internal allocation boundary (currently 4 MB).

Return value

Type: BOOL 

Returns TRUE if the hysteresis could be set, else FALSE.

Remarks

Hysteresis can be set on each of the separate heaps that XMemAllocDefault maintains. There are separate heaps for every memory type enumerated by the XALLOC_MEMTYPE_GRAPHICS constants (only the graphics types maintain heaps).

Requirements

Header: Declared in xmem.h.