This is not something you can do through CLR hosting. If you host the CLR, you can fulfill the distribution requirements from the GC to Windows, for example. so instead of VirtualAlloc it uses a different allocator. However, the host is not called every time the object is allocated (it would be too expensive).
Theoretically, you can do this using the CLR profiling API. This allows you to receive a callback whenever an object is highlighted.
, . , , , , , , API- Win32?