IMalloc::DidAlloc

Determines if this allocator was used to allocate the specified block of memory.

int DidAlloc(
  void *pv  //Pointer to the memory block
);
 

Parameter

pv
[in] Pointer to the memory block; can be a NULL pointer, in which case, -1 is returned.

Return Values

1
The memory block was allocated by this IMalloc instance.
0
The memory block was not allocated by this IMalloc instance.
-1
DidAlloc is unable to determine whether or not it allocated the memory block.

Remarks

Calling IMalloc::DidAlloc is useful if a application is using multiple allocations, and needs to know whether a previously allocated block of memory was allocated by a particular allocation.

QuickInfo

  Windows NT: Use version 3.1 or later.
  Windows: Use Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in objidl.h.

See Also

IMalloc::Alloc, IMalloc::HeapMinimize, IMalloc::Realloc