IMethodMalloc 接口IMethodMalloc Interface

提供一个方法,用于为新的 Microsoft 中间语言(MSIL)函数体分配内存。Provides a method to allocate memory for a new Microsoft intermediate language (MSIL) function body.

备注

IMethodMalloc 接口是一个简单的内存分配器。The IMethodMalloc interface is a simple memory allocator. 它允许您分配内存,但不能释放内存。It allows you to allocate memory, but not to free it.

方法Methods

方法Method 描述Description
Alloc 方法Alloc Method 尝试为新的 MSIL 函数体分配指定的内存量。Attempts to allocate a specified amount of memory for a new MSIL function body.

备注Remarks

每个分配器都是特定于模块的,并确保函数体与模块的基偏移为正偏移量。Each allocator is module-specific and ensures that the function body will be at a positive offset from the base of the module. 超出模块基的内存可能非常宝贵,因此应使用分配器仅为函数体分配内存。Memory above the base of a module can be precious, so the allocator should be used to allocate memory only for a function body.

需求Requirements

平台: 请参阅系统要求Platforms: See System Requirements.

头文件: CorProf.idl、CorProf.hHeader: CorProf.idl, CorProf.h

库: CorGuids.libLibrary: CorGuids.lib

.NET Framework 版本: 自 2.0 之后可用Available since 2.0.NET Framework Versions: 自 2.0 之后可用Available since 2.0

另请参阅See also