SDCreateMemoryList (Windows CE 5.0)

Send Feedback

This function creates a memory look-aside list.

SD_MEMORY_LIST_HANDLE SDCreateMemoryList(ULONGTag,
  ULONGDepth,
  ULONGEntrySize);

Parameters

  • Tag
    [in] Reserved.
  • Depth
    [in] Threshold of committed memory list size.
  • EntrySize
    [in] Size of each entry.

Return Values

Returns a handle to the memory list. The handle can be used to allocate and free entries from the memory list. Returns NULL if the memory list could not be created.

Remarks

This function creates a memory look-aside list containing initial entries equal to the Depth parameter. The look-aside list provides a driver with a method of pre-allocating and recycling often-used memory blocks. The driver can retrieve these memory blocks from the list, using the SDAllocateFromMemList function. Blocks are freed back to the list using the SDFreeToMemList function. Freed blocks are added back to the memory list rather than returned to the system heap. If the memory list is empty, additional blocks are allocated from the heap. These additional blocks are freed back to the heap in order to allow the memory list to return to its normal depth. When allocating blocks, a driver should not assume that the blocks are zero initialized.

A driver can use the SDDeleteMemList function to delete a memory list. The driver must return all allocations back to the memory list before deleting the memory list, or a memory leak will occur.

Requirements

OS Versions: Windows CE 5.0 and later.
Header: Sdcardddk.h.
Link Library: Sdcardlib.lib.

See Also

Secure Digital Card Driver Functions | SDAllocateFromMemList | SDFreeToMemList | SDDeleteMemList

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.