Trait mmtk::policy::space::Space[][src]

pub trait Space<VM: VMBinding>: 'static + SFT + Sync + Downcast {
    fn as_space(&self) -> &dyn Space<VM>;
fn as_sft(&self) -> &(dyn SFT + Sync + 'static);
fn get_page_resource(&self) -> &dyn PageResource<VM>;
fn init(&mut self, vm_map: &'static VMMap);
fn common(&self) -> &CommonSpace<VM>;
unsafe fn unsafe_common_mut(&self) -> &mut CommonSpace<VM>;
fn release_multiple_pages(&mut self, start: Address); fn acquire(&self, tls: OpaquePointer, pages: usize) -> Address { ... }
fn address_in_space(&self, start: Address) -> bool { ... }
fn in_space(&self, object: ObjectReference) -> bool { ... }
unsafe fn grow_discontiguous_space(&self, chunks: usize) -> Address { ... }
fn grow_space(&self, start: Address, bytes: usize, new_chunk: bool) { ... }
fn ensure_mapped(&self) { ... }
fn reserved_pages(&self) -> usize { ... }
fn get_name(&self) -> &'static str { ... }
fn common_mut(&mut self) -> &mut CommonSpace<VM> { ... }
fn release_discontiguous_chunks(&mut self, chunk: Address) { ... }
unsafe fn release_all_chunks(&self) { ... }
fn print_vm_map(&self) { ... }
fn local_side_metadata_specs(&self) -> &[SideMetadataSpec] { ... } }

Required methods

fn as_space(&self) -> &dyn Space<VM>[src]

fn as_sft(&self) -> &(dyn SFT + Sync + 'static)[src]

fn get_page_resource(&self) -> &dyn PageResource<VM>[src]

fn init(&mut self, vm_map: &'static VMMap)[src]

fn common(&self) -> &CommonSpace<VM>[src]

unsafe fn unsafe_common_mut(&self) -> &mut CommonSpace<VM>[src]

Safety

This get’s a mutable reference from self. (i.e. make sure their are no concurrent accesses through self when calling this)_

fn release_multiple_pages(&mut self, start: Address)[src]

Loading content...

Provided methods

fn acquire(&self, tls: OpaquePointer, pages: usize) -> Address[src]

fn address_in_space(&self, start: Address) -> bool[src]

fn in_space(&self, object: ObjectReference) -> bool[src]

unsafe fn grow_discontiguous_space(&self, chunks: usize) -> Address[src]

Safety

potential data race as this mutates ‘common’ FIXME: This does not sound like ‘unsafe’, it is more like ‘incorrect’. Any allocator/mutator may do slowpath allocation, and call this.

fn grow_space(&self, start: Address, bytes: usize, new_chunk: bool)[src]

This hook is called by page resources each time a space grows. The space may tap into the hook to monitor heap growth. The call is made from within the page resources’ critical region, immediately before yielding the lock.

@param start The start of the newly allocated space @param bytes The size of the newly allocated space @param new_chunk {@code true} if the new space encroached upon or started a new chunk or chunks.

fn ensure_mapped(&self)[src]

Ensure this space is marked as mapped – used when the space is already mapped (e.g. for a vm image which is externally mmapped.)

fn reserved_pages(&self) -> usize[src]

fn get_name(&self) -> &'static str[src]

fn common_mut(&mut self) -> &mut CommonSpace<VM>[src]

fn release_discontiguous_chunks(&mut self, chunk: Address)[src]

unsafe fn release_all_chunks(&self)[src]

Safety

TODO: I am not sure why this is unsafe.

fn print_vm_map(&self)[src]

fn local_side_metadata_specs(&self) -> &[SideMetadataSpec][src]

Loading content...

Implementations

impl<VM> dyn Space<VM> where
    VM: Any + 'static,
    VM: VMBinding
[src]

pub fn is<__T: Space<VM>>(&self) -> bool[src]

Returns true if the trait object wraps an object of type __T.

pub fn downcast<__T: Space<VM>>(self: Box<Self>) -> Result<Box<__T>, Box<Self>>[src]

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn’t.

pub fn downcast_rc<__T: Space<VM>>(self: Rc<Self>) -> Result<Rc<__T>, Rc<Self>>[src]

Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of type __T. Returns the original Rc-ed trait if it isn’t.

pub fn downcast_ref<__T: Space<VM>>(&self) -> Option<&__T>[src]

Returns a reference to the object within the trait object if it is of type __T, or None if it isn’t.

pub fn downcast_mut<__T: Space<VM>>(&mut self) -> Option<&mut __T>[src]

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn’t.

Implementors

impl<VM: VMBinding> Space<VM> for CopySpace<VM>[src]

impl<VM: VMBinding> Space<VM> for ImmortalSpace<VM>[src]

impl<VM: VMBinding> Space<VM> for LargeObjectSpace<VM>[src]

impl<VM: VMBinding> Space<VM> for LockFreeImmortalSpace<VM>[src]

impl<VM: VMBinding> Space<VM> for MallocSpace<VM>[src]

Loading content...