Evo C++ Library v0.5.1
Static Public Member Functions | Static Public Attributes | List of all members
Capacity Class Reference

#include <evo/impl/container.h>

Detailed Description

Optimized container size and capacity calculation.

Static Public Member Functions

static ulong grow (ulong size)
 Grow data size. More...
 
static ulong init (ulong size)
 Get initial data size. More...
 

Static Public Attributes

static const ulong INIT = 64
 Default initial size. More...
 
static const ulong THRESHOLD = 134217728
 Growth threshold (max size increase) (128*1024*1024) More...
 

Member Function Documentation

◆ grow()

static ulong grow ( ulong  size)
inlinestatic

Grow data size.

  • The data size is grown by a factor of 1.5x or THRESHOLD, whichever is smaller
  • Returns ULONG_MAX on overflow
Parameters
sizeSize to grow - must be less than ULONG_MAX
Returns
Adjusted data size

◆ init()

static ulong init ( ulong  size)
inlinestatic

Get initial data size.

Parameters
sizeInitial size to adjust, if needed
Returns
Adjusted initial size (given size or INIT, whichver is smaller)

Member Data Documentation

◆ INIT

const ulong INIT = 64
static

Default initial size.

◆ THRESHOLD

const ulong THRESHOLD = 134217728
static

Growth threshold (max size increase) (128*1024*1024)


The documentation for this class was generated from the following file: