ICorProfilerInfo::GetILFunctionBodyAllocator Method

Gets an interface that provides a method to allocate memory to be used for swapping out the body of a method in Microsoft intermediate language (MSIL) code.


HRESULT GetILFunctionBodyAllocator(  
    [in]  ModuleID      moduleId,  
    [out] IMethodMalloc **ppMalloc);  


[in] The ID of the module in which the method resides.

[out] A pointer to an IMethodMalloc interface that provides a method to allocate the memory.


A method body in MSIL code must be located as a relative virtual address (RVA), relative to the loaded module, which means that it follows the module within 4 GB. To make it easier for a tool to swap out the body of a method, the GetILFunctionBodyAllocator method ensures that memory is allocated within that range.


Platforms: See System Requirements.

Header: CorProf.idl, CorProf.h

Library: CorGuids.lib

.NET Framework Versions: Available since 2.0

See also