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.
Methods
The IMallocSpy interface inherits the methods of the IUnknown interface.
In addition, IMallocSpy defines the following methods.
Requirements
| Minimum supported client | Windows 2000 Professional |
| Minimum supported server | Windows 2000 Server |
| Header | ObjIdl.h |
| IDL | ObjIdl.idl |
| IID | IID_IMallocSpy is defined as 0000001d-0000-0000-C000-000000000046 |
See Also
- CoGetMalloc
- CoRegisterMallocSpy
- CoRevokeMallocSpy
- IMalloc
Send comments about this topic to Microsoft
Build date: 11/12/2009