Standard library » Containers » Allocator module

Generic allocators where allocation and release are not O(1) operations.

An allocator doesn't destroy its elements in its destructor, they must be destroyed manually.

It doesn't throw exceptions. Instead, asserts are used to ensure valid usage.

Files

file bn_best_fit_allocator.h
file bn_config_best_fit_allocator.h

Classes

class bn::best_fit_allocator
Manages a chunk of memory with a best fit allocation strategy.

Defines

#define BN_CFG_BEST_FIT_ALLOCATOR_SANITY_CHECK_ENABLED
#define BN_CFG_BEST_FIT_ALLOCATOR_FREE_CHECK_ENABLED

Define documentation

#define BN_CFG_BEST_FIT_ALLOCATOR_SANITY_CHECK_ENABLED

Specifies if bn::best_fit_allocator sanity check is enabled or not.

Sanity check asserts if the internal state of the allocator is valid.

#define BN_CFG_BEST_FIT_ALLOCATOR_FREE_CHECK_ENABLED

Specifies if bn::best_fit_allocator::free checks if the input pointer is valid or not.