Skip to content

MemoryAllocator

MemoryAllocator is an abstraction of memory allocators that TaskMemoryManager uses to allocate and release memory.

MemoryAllocator creates the available MemoryAllocators to be available under the names HEAP and UNSAFE.

A MemoryAllocator to use is selected when MemoryManager is created (based on MemoryMode).

Contract

Allocating Contiguous Block of Memory

MemoryBlock allocate(
  long size)

Used when:

Releasing Memory

void free(
  MemoryBlock memory)

Used when:

Implementations

  • HeapMemoryAllocator
  • UnsafeMemoryAllocator