# IMallocSpy::PostAlloc

Called just after invoking IMalloc::Alloc, taking as input a pointer to the IMalloc::Alloc caller’s allocation, and returning a pointer to the actual allocation.

void * PostAlloc(

void * pActual | //Pointer to the allocation actually done by IMalloc::Alloc
); |

Parameter

pActual
  [in] Pointer to the allocation done by IMalloc::Alloc.

Return Value

A pointer to the beginning of the memory block actually allocated. This pointer is also returned to the caller of IMalloc::Alloc. If debug information is written at the front of the caller’s allocation, this should be a forward offset from pActual. The value is the same as pActual if debug information is appended or if no debug information is attached.

Remarks

When a spy object implementing IMallocSpy is registered with CoRegisterMallocSpy, OLE calls IMallocSpy::PostAlloc after any call to IMalloc::Alloc. It takes as input a pointer to the allocation done by the call to IMalloc::Alloc, and returns a pointer to the beginning of the total allocation, which could include a forward offset from the other value if IMallocSpy::Prealloc was implemented to attach debug information to the allocation in this way. If not, the same pointer is returned, and also becomes the return value to the caller of IMalloc::Alloc.

See Also

IMalloc::Alloc, IMallocSpy::PreAlloc, CoRegisterMallocSpy, CoRevokeMallocSpy