Module alloc

Module alloc 

Source
Expand description

Allocators Various allocators implementation.

Re-exportsยง

pub use self::immix_allocator::ImmixAllocator;
pub use free_list_allocator::FreeListAllocator;

Modulesยง

allocator ๐Ÿ”’
The allocator trait and allocation-related functions.
allocators ๐Ÿ”’
A list of all the allocators, embedded in Mutator
bumpallocator ๐Ÿ”’
Bump pointer allocator
embedded_meta_data ๐Ÿ”’
Embedded metadata pages
free_list_allocator
Free list allocator based on Mimalloc
immix_allocator
Immix allocator
large_object_allocator ๐Ÿ”’
malloc_allocator ๐Ÿ”’
An alloactor backed by malloc
markcompact_allocator ๐Ÿ”’
Mark compact allocator (actually a bump pointer allocator with an extra heade word)

Structsยง

AllocationOptions
Allow specifying different behaviors with Allocator::alloc_with_options.
BumpAllocator
A bump pointer allocator. It keeps a thread local allocation buffer, and bumps a cursor to allocate from the buffer.
BumpPointer
A common fast-path bump-pointer allocator shared across different allocator implementations that use bump-pointer allocation. A BumpPointer is always initialized with cursor = 0, limit = 0, so the first allocation always fails the check of cursor + size < limit and goes to the slowpath. A binding can also take advantage of this design to zero-initialize the a bump pointer.
LargeObjectAllocator
An allocator that only allocates at page granularity. This is intended for large objects.
MallocAllocator
The allocator that internally uses malloc for all the allocation requests. This allocator is only intended for experimental uses.
MarkCompactAllocator
A thin wrapper(specific implementation) of bump allocator reserve extra bytes when allocating

Enumsยง

AllocationError
A list of errors that MMTk can encounter during allocation.
AllocatorInfo
This type describes allocator information. It is used to generate fast paths for the GC. All offset fields are relative to Mutator.
AllocatorSelector
This type describe an allocator in the crate::Mutator. For some VM bindings, they may need to access this type from native code. This type is equivalent to the following native types: #[repr(C)] struct AllocatorSelector { tag: AllocatorSelectorTag, payload: u8, } #[repr(u8)] enum AllocatorSelectorTag { BumpPointer, LargeObject, โ€ฆ }

Traitsยง

Allocator
A trait which implements allocation routines. Every allocator needs to implements this trait.

Functionsยง

fill_alignment_gap
Fill the specified region with the alignment value.