Share via


IMalloc::DidAlloc (Compact 2013)

3/26/2014

This method determines whether this allocator was used to allocate the specified block of memory.

Syntax

int DidAlloc(
  void* pv 
);

Parameters

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

Return Value

The following table shows the return values for this method.

Value

Description

1

The memory block was allocated by this IMalloc instance.

0

The memory block was not allocated by this IMalloc instance.

-1

IMalloc::DidAlloc is unable to determine whether or not it allocated the memory block.

Remarks

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

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Requirements

Header

objidl.h,
objidl.idl

Library

ole32.lib

See Also

Reference

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