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.
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.
| Method | Description |
|---|---|
| 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 |
|
|
IDL |
|
|
IID |
IID_IMallocSpy is defined as 0000001d-0000-0000-C000-000000000046 |
See also