IMethodMalloc::Alloc Method

Attempts to allocate a specified amount of memory for a new Microsoft intermediate language (MSIL) function body.

PVOID Alloc (
    [in] ULONG   cb
);

Parameters

  • cb
    [in] The number of bytes to allocate for the method body.

Remarks

The allocated memory will begin at an address greater than the base address of the module that is associated with this allocator. In other words, each allocator is created for a particular module, and will attempt to allocate memory at a positive offset from its base address. If Alloc fails to allocate the requested number of bytes at an address greater than the base address of the module, it returns E_OUTOFMEMORY, regardless of the actual amount of memory space available.

The Alloc method should be used in conjunction with the ICorProfilerInfo::SetILFunctionBody method.

Requirements

Platforms: WindSee .NET Framework System Requirements.

Header: CorProf.idl, CorProf.h

Library: CorGuids.lib

.NET Framework Versions: 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0

See Also

Reference

IMethodMalloc Interface