Module two_level_storage

Module two_level_storage 

Source
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ยง

TwoLevelStateStorage
A two-level implementation of MapStateStorage.

Constantsยง

LOG_MAPPABLE_BYTES ๐Ÿ”’
Logarithm of the address space size that TwoLevelStateStorage is 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_MMAP_CHUNKS_PER_SLAB ๐Ÿ”’
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 of LOG_MAPPABLE_BYTES and LOG_BYTES_IN_CHUNK in order to make MMAP_SLAB_BYTES the geometric mean of MAPPABLE_BYTES and BYTES_IN_CHUNK. This will balance the array size of TwoLevelStateStorage::slabs and Slab.
MAPPABLE_ADDRESS_LIMIT ๐Ÿ”’
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 MapState of multiple chunks.