cuprate_database

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§

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

Statics§

  • This retrieves the system’s memory page size.

Functions§

  • Memory map resize by a fixed amount of bytes.
  • Memory map resize closely matching monerod.
  • Memory map resize by a percentage.