[][src]Struct context_coroutine::CoroutineMemorySource

pub struct CoroutineMemorySource<GTACSA: 'static + GlobalThreadAndCoroutineSwitchableAllocator, CoroutineLocalAllocatorConstructor: Fn(RcMemorySource<ArenaMemorySource<MemoryMapSource>>, NonZeroUsize) -> Result<GTACSA::CoroutineLocalAllocator, AllocErr>> { /* fields omitted */ }

This design does not use a guard page (via mprotect(PROT_NONE)) to separate the heap and stack.

Guard pages need to be at least 1Mb to be effective (see discussion in https://www.openwall.com/lists/oss-security/2017/06/19/1), which is probably too large for coroutines if using a design that ensures all virtual memory is physically backed.

Methods

impl<GTACSA: GlobalThreadAndCoroutineSwitchableAllocator, CoroutineLocalAllocatorConstructor: Fn(RcMemorySource<ArenaMemorySource<MemoryMapSource>>, NonZeroUsize) -> Result<GTACSA::CoroutineLocalAllocator, AllocErr>> CoroutineMemorySource<GTACSA, CoroutineLocalAllocatorConstructor>[src]

pub fn new(
    global_allocator: &'static GTACSA,
    coroutine_local_allocator_constructor: CoroutineLocalAllocatorConstructor,
    memory_map_source: MemoryMapSource,
    memory_source_size: NonZeroUsize,
    heap_size: NonZeroUsize,
    stack_size: NonZeroUsize
) -> Result<Self, AllocErr>
[src]

Creates a new instance.

Trait Implementations

impl<GTACSA: Debug + 'static + GlobalThreadAndCoroutineSwitchableAllocator, CoroutineLocalAllocatorConstructor: Debug + Fn(RcMemorySource<ArenaMemorySource<MemoryMapSource>>, NonZeroUsize) -> Result<GTACSA::CoroutineLocalAllocator, AllocErr>> Debug for CoroutineMemorySource<GTACSA, CoroutineLocalAllocatorConstructor>[src]

Auto Trait Implementations

impl<GTACSA, CoroutineLocalAllocatorConstructor> !Send for CoroutineMemorySource<GTACSA, CoroutineLocalAllocatorConstructor>

impl<GTACSA, CoroutineLocalAllocatorConstructor> !Sync for CoroutineMemorySource<GTACSA, CoroutineLocalAllocatorConstructor>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.