Expand description
This module contains TwoLevelMmapper
, an implementation of Mmapper
that is designed to
work well on 64-bit machines. Currently it supports 48-bit address spaces, and many constants
and data structures (such as Slab
) are larger than i32::MAX
. For this reason, this module
is only available on 64-bit machines.
Structsยง
- A two-level implementation of
Mmapper
.
Constantsยง
- LOG_
MAPPABLE_ ๐BYTES Logarithm of the address space size a user-space program is allowed to use. This is enough for ARM64, x86_64 and some other architectures. Feel free to increase it if we plan to support larger address spaces. - LOG_
MAX_ ๐SLABS Logarithm of maximum number of slabs. - Log number of chunks per slab.
- LOG_
MMAP_ ๐SLAB_ BYTES Log number of bytes per slab. For a two-level array, it is advisable to choose the arithmetic mean ofLOG_MAPPABLE_BYTES
andLOG_MMAP_CHUNK_BYTES
in order to makeMMAP_SLAB_BYTES
the geometric mean ofMAPPABLE_BYTES
andMMAP_CHUNK_BYTES
. This will balance the array size ofTwoLevelMmapper::slabs
andSlab
. - MAPPABLE_
BYTES ๐Address space size a user-space program is allowed to use. - MAX_
SLABS ๐maximum number of slabs. - MMAP_
CHUNKS_ ๐PER_ SLAB Number of chunks per slab. - MMAP_
SLAB_ ๐BYTES Number of bytes per slab. - MMAP_
SLAB_ ๐MASK Mask for getting in-slab bits from an address. Invert this to get out-of-slab bits.
Type Aliasesยง
- Slab ๐The slab type. Each slab holds the
MapState
of multiple chunks.