mmtk::memory_manager

Function alloc_with_options

source
pub fn alloc_with_options<VM: VMBinding>(
    mutator: &mut Mutator<VM>,
    size: usize,
    align: usize,
    offset: usize,
    semantics: AllocationSemantics,
    options: AllocationOptions,
) -> Address
Expand description

Allocate memory for an object.

This allocation function allows alternation to the allocation behaviors, specified by the crate::util::alloc::AllocationOptions. For example, one can allow overcommit the memory to go beyond the heap size without triggering a GC. This function can be used in certain cases where the runtime needs a different allocation behavior other than what the default alloc provides.

Arguments:

  • mutator: The mutator to perform this allocation request.
  • size: The number of bytes required for the object.
  • align: Required alignment for the object.
  • offset: Offset associated with the alignment.
  • semantics: The allocation semantic required for the allocation.
  • options: the allocation options to change the default allocation behavior for this request.