Export (0) Print
Expand All
0 out of 2 rated this helpful - Rate this topic

IMallocSpy interface

Enables application developers to monitor (spy on) memory allocation, detect memory leaks, and simulate memory failure in calls to IMalloc methods.

When to implement

Implement this interface to debug memory allocation during application development.

Caution  The IMallocSpy interface is intended only for use in debugging application code under development. Do not ship this interface to retail customers of your application because it causes severe performance degradation and could conflict with user-installed software to produce unpredictable results.

When to use

When an implementation of IMallocSpy is registered with CoRegisterMallocSpy, COM calls the pair of IMallocSpy methods around the corresponding IMalloc method. You would not make direct calls to IMallocSpy methods.

The call to the pre-method through the return from the corresponding post-method is guaranteed to be thread-safe in multithreaded operations.

Members

The IMallocSpy interface inherits from the IUnknown interface. IMallocSpy also has these types of members:

Methods

The IMallocSpy interface has these methods.

MethodDescription
PostAlloc

Performs operations required after calling IMalloc::Alloc.

PostDidAlloc

Performs operations required after calling IMalloc::DidAlloc.

PostFree

Performs operations required after calling IMalloc::Free.

PostGetSize

Performs operations required after calling IMalloc::GetSize.

PostHeapMinimize

Performs operations required after calling IMalloc::HeapMinimize.

PostRealloc

Performs operations required after calling IMalloc::Realloc.

PreAlloc

Performs operations required before calling IMalloc::Alloc.

PreDidAlloc

Performs operations required before calling IMalloc::DidAlloc.

PreFree

Performs operations required before calling IMalloc::Free.

PreGetSize

Performs operations required before calling IMalloc::GetSize.

PreHeapMinimize

Performs operations required before calling IMalloc::HeapMinimize.

PreRealloc

Performs operations required before calling IMalloc::Realloc.

 

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

ObjIdl.h

IDL

ObjIdl.idl

IID

IID_IMallocSpy is defined as 0000001d-0000-0000-C000-000000000046

See also

CoGetMalloc
CoRegisterMallocSpy
CoRevokeMallocSpy
IMalloc

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.