Module mmtk::util::alloc

source ·
Expand description

Allocators Various allocators implementation.

Re-exports§

Modules§

Structs§

  • A bump pointer allocator. It keeps a thread local allocation buffer, and bumps a cursor to allocate from the buffer.
  • 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.
  • An allocator that only allocates at page granularity. This is intended for large objects.
  • The allocator that internally uses malloc for all the allocation requests. This allocator is only intended for experimental uses.
  • A thin wrapper(specific implementation) of bump allocator reserve extra bytes when allocating

Enums§

  • A list of errors that MMTk can encounter during allocation.
  • This type describes allocator information. It is used to generate fast paths for the GC. All offset fields are relative to Mutator.
  • 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§

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

Functions§