pub struct MemoryImageSlot { /* private fields */ }
Expand description

A single slot handled by the copy-on-write memory initialization mechanism.

The mmap scheme is:

base ==> (points here)

  • (image.offset bytes) anonymous zero memory, pre-image
  • (image.len bytes) CoW mapping of memory image
  • (up to static_size) anonymous zero memory, post-image

The ordering of mmaps to set this up is:

  • once, when pooling allocator is created:

    • one large mmap to create 8GiB * instances * memories slots
  • per instantiation of new image in a slot:

    • mmap of anonymous zero memory, from 0 to max heap size (static_size)
    • mmap of CoW’d image, from image.offset to image.offset + image.len. This overwrites part of the anonymous zero memory, potentially splitting it into a pre- and post-region.
    • mprotect(PROT_NONE) on the part of the heap beyond the initial heap size; we re-mprotect it with R+W bits when the heap is grown.

Trait Implementations§

Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.