b2api
B2000++ API Reference Manual, VERSION 4.6
 
Loading...
Searching...
No Matches
b2000::Allocator Class Reference

#include "b2allocator.H"

Detailed Description

A class that implements a specialised memory allocator.

The only method to free memory is to call the destructor of the allocator that will free all the allocated memory. It's providing a very cheap "bump allocator" within blocks of allocated memory but automatically allocates a new memory block if the currently used one runs out of space.

This allocator provides the possibility to bind the lifetime of various small objects together and free them up all together, rather than taking care of individually freeing each small object.

Of course this also means that all objects allocated via such an allocator are only valid during the lifetime of the allocator itself.

The blocking mechanism can be deactivated by setting the environment variable GLIBCXX_FORCE_NEW which causes the allocator to use a new block for each allocation.

If an object larger than 1/8 the block_size gets allocated and requires a new block, the block size is increased accordingly.


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