[][src]Trait mmtk::Plan

pub trait Plan: Sized + 'static + Sync + Send {
    type VM: VMBinding;
    type Mutator: MutatorContext<Self::VM>;
    type CopyContext: CopyContext;
    fn new(
        vm_map: &'static VMMap,
        mmapper: &'static Mmapper,
        options: Arc<UnsafeOptionsWrapper>,
        scheduler: &'static MMTkScheduler<Self::VM>
    ) -> Self;
fn base(&self) -> &BasePlan<Self::VM>;
fn schedule_collection(&'static self, _scheduler: &MMTkScheduler<Self::VM>);
fn gc_init(
        &mut self,
        heap_size: usize,
        vm_map: &'static VMMap,
        scheduler: &Arc<MMTkScheduler<Self::VM>>
    );
fn bind_mutator(
        &'static self,
        tls: OpaquePointer,
        mmtk: &'static MMTK<Self::VM>
    ) -> Box<Self::Mutator>;
fn get_allocator_mapping(
        &self
    ) -> &'static EnumMap<AllocationSemantics, AllocatorSelector>;
fn prepare(&self, tls: OpaquePointer);
fn release(&self, tls: OpaquePointer);
fn get_pages_used(&self) -> usize; fn common(&self) -> &CommonPlan<Self::VM> { ... }
fn mmapper(&self) -> &'static Mmapper { ... }
fn options(&self) -> &Options { ... }
fn in_nursery(&self) -> bool { ... }
fn is_initialized(&self) -> bool { ... }
fn poll(&self, space_full: bool, space: &dyn Space<Self::VM>) -> bool { ... }
fn log_poll(&self, space: &dyn Space<Self::VM>, message: &'static str) { ... }
fn collection_required(
        &self,
        space_full: bool,
        _space: &dyn Space<Self::VM>
    ) -> bool
    where
        Self: Sized
, { ... }
fn get_pages_reserved(&self) -> usize { ... }
fn get_total_pages(&self) -> usize { ... }
fn get_pages_avail(&self) -> usize { ... }
fn get_collection_reserve(&self) -> usize { ... }
fn is_emergency_collection(&self) -> bool { ... }
fn get_free_pages(&self) -> usize { ... }
fn stress_test_gc_required(&self) -> bool { ... }
fn handle_user_collection_request(&self, tls: OpaquePointer, force: bool) { ... }
fn reset_collection_trigger(&self) { ... }
fn modify_check(&self, object: ObjectReference) { ... } }

A plan describes the global core functionality for all memory management schemes. All global MMTk plans should implement this trait.

The global instance defines and manages static resources (such as memory and virtual memory resources).

Associated Types

Loading content...

Required methods

fn new(
    vm_map: &'static VMMap,
    mmapper: &'static Mmapper,
    options: Arc<UnsafeOptionsWrapper>,
    scheduler: &'static MMTkScheduler<Self::VM>
) -> Self

fn base(&self) -> &BasePlan<Self::VM>

fn schedule_collection(&'static self, _scheduler: &MMTkScheduler<Self::VM>)

fn gc_init(
    &mut self,
    heap_size: usize,
    vm_map: &'static VMMap,
    scheduler: &Arc<MMTkScheduler<Self::VM>>
)

fn bind_mutator(
    &'static self,
    tls: OpaquePointer,
    mmtk: &'static MMTK<Self::VM>
) -> Box<Self::Mutator>

fn get_allocator_mapping(
    &self
) -> &'static EnumMap<AllocationSemantics, AllocatorSelector>

fn prepare(&self, tls: OpaquePointer)

fn release(&self, tls: OpaquePointer)

fn get_pages_used(&self) -> usize

Loading content...

Provided methods

fn common(&self) -> &CommonPlan<Self::VM>

fn mmapper(&self) -> &'static Mmapper

fn options(&self) -> &Options

fn in_nursery(&self) -> bool

fn is_initialized(&self) -> bool

fn poll(&self, space_full: bool, space: &dyn Space<Self::VM>) -> bool

fn log_poll(&self, space: &dyn Space<Self::VM>, message: &'static str)

fn collection_required(
    &self,
    space_full: bool,
    _space: &dyn Space<Self::VM>
) -> bool where
    Self: Sized

This method controls the triggering of a GC. It is called periodically during allocation. Returns true to trigger a collection.

@param spaceFull Space request failed, must recover pages within 'space'. @param space TODO @return true if a collection is requested by the plan.

fn get_pages_reserved(&self) -> usize

fn get_total_pages(&self) -> usize

fn get_pages_avail(&self) -> usize

fn get_collection_reserve(&self) -> usize

fn is_emergency_collection(&self) -> bool

fn get_free_pages(&self) -> usize

fn stress_test_gc_required(&self) -> bool

fn handle_user_collection_request(&self, tls: OpaquePointer, force: bool)

fn reset_collection_trigger(&self)

fn modify_check(&self, object: ObjectReference)

Loading content...

Implementors

Loading content...