Expand description
This module contains TwoLevelStateStorage, an implementation of MapStateStorage 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
MapStateStorage.
Constantsยง
- LOG_
MAPPABLE_ ๐BYTES Logarithm of the address space size thatTwoLevelStateStorageis able to handle. 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_BYTESandLOG_BYTES_IN_CHUNKin order to makeMMAP_SLAB_BYTESthe geometric mean ofMAPPABLE_BYTESandBYTES_IN_CHUNK. This will balance the array size ofTwoLevelStateStorage::slabsandSlab. - The limit of mappable address
- 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
MapStateof multiple chunks.