Module resize

Source
Expand description

Database memory map resizing algorithms.

This modules contains ResizeAlgorithm which determines how the ConcreteEnv resizes its memory map when needing more space. This value is in Config and can be selected at runtime.

Although, it is only used by ConcreteEnv if Env::MANUAL_RESIZE is true.

The algorithms are available as free functions in this module as well.

§Page size

All free functions in this module will return a multiple of the OS page size (PAGE_SIZE), LMDB will error if this is not the case.

§Invariants

All returned NonZeroUsize values of the free functions in this module (including ResizeAlgorithm::resize) uphold the following invariants:

  1. It will always be >= the input current_size_bytes
  2. It will always be a multiple of PAGE_SIZE

Enums§

ResizeAlgorithm
The function/algorithm used by the database when resizing the memory map.

Statics§

PAGE_SIZE
This retrieves the system’s memory page size.

Functions§

fixed_bytes
Memory map resize by a fixed amount of bytes.
monero
Memory map resize closely matching monerod.
percent
Memory map resize by a percentage.