Skip to content

Struct mdbx::default_capacity_policy

ClassList > mdbx > default_capacity_policy

The default capacity policy for the buffer class: rounds the allocated capacity and advises whether to grow, keep or shrink it.

  • #include <mdbx.h++>

Public Types

Type Name
enum size_t @274021104001224022070246350126215054256204003162
Policy constants.

Public Static Functions

Type Name
size_t advise (const size_t current, const size_t wanna, const size_t inplace)
Advises the capacity for the requested size.
size_t round (const size_t value)
Rounds the given value up to the pettiness_threshold granularity.

Public Types Documentation

enum @274021104001224022070246350126215054256204003162

Policy constants.

enum mdbx::default_capacity_policy::@274021104001224022070246350126215054256204003162 {
    extra_inplace_storage = 0,
    inplace_storage_size_rounding = 16,
    pettiness_threshold = 64,
    max_reserve = 65536
};

Public Static Functions Documentation

function advise

Advises the capacity for the requested size.

static inline size_t mdbx::default_capacity_policy::advise (
    const size_t current,
    const size_t wanna,
    const size_t inplace
) 

Parameters:

  • current The currently allocated capacity.
  • wanna The requested capacity.
  • inplace The size of the inplace storage available without allocation.

Returns:

The advised capacity to be (re)allocated.


function round

Rounds the given value up to the pettiness_threshold granularity.

static inline size_t mdbx::default_capacity_policy::round (
    const size_t value
) 

Parameters:

  • value The value to be rounded.

Returns:

The rounded value.



The documentation for this class was generated from the following file mdbx.h++