BitMagic-C++: bm::alloc_pool< BA, PA > Class Template Reference

BitMagic-C++

Public Types | Public Member Functions | Protected Attributes
bm::alloc_pool< BA, PA > Class Template Reference
BitMagic Library » bvector<> container » Allocator

Allocation pool object. More...

`#include <bmalloc.h>`

Collaboration diagram for bm::alloc_pool< BA, PA >:
[legend]

## Public Types
typedef BA | block_allocator_type
typedef PA | ptr_allocator_type

## Public Member Functions
| alloc_pool ()
| ~alloc_pool ()
bm::word_t * | alloc_bit_block ()
void | free_bit_block (bm::word_t *block) BMNOEXCEPT
void | free_pools () BMNOEXCEPT

## Protected Attributes
pointer_pool_array | block_pool_
BA | block_alloc_

## Detailed Description

### template<class BA, class PA>
class bm::alloc_pool< BA, PA >

Allocation pool object.

Examples
  sample6.cpp.

Definition at line 200 of file bmalloc.h.

## Member Typedef Documentation

## ◆ block_allocator_type

template<class BA , class PA >

typedef BA bm::alloc_pool< BA, PA >::block_allocator_type

Definition at line 203 of file bmalloc.h.

## ◆ ptr_allocator_type

template<class BA , class PA >

typedef PA bm::alloc_pool< BA, PA >::ptr_allocator_type

Definition at line 204 of file bmalloc.h.

## Constructor & Destructor Documentation

## ◆ alloc_pool()

template<class BA , class PA >

bm::alloc_pool< BA, PA >::alloc_pool | ( |  | ) |
| inline

Definition at line 208 of file bmalloc.h.

## ◆ ~alloc_pool()

template<class BA , class PA >

bm::alloc_pool< BA, PA >::~alloc_pool | ( |  | ) |
| inline

Definition at line 209 of file bmalloc.h.

References bm::alloc_pool< BA, PA >::free_pools().

## Member Function Documentation

## ◆ alloc_bit_block()

template<class BA , class PA >

bm::word_t* bm::alloc_pool< BA, PA >::alloc_bit_block | ( |  | ) |
| inline

Definition at line 214 of file bmalloc.h.

References bm::alloc_pool< BA, PA >::block_alloc_, bm::alloc_pool< BA, PA >::block_pool_, bm::pointer_pool_array::pop(), and bm::set_block_size.

## ◆ free_bit_block()

template<class BA , class PA >

void bm::alloc_pool< BA, PA >::free_bit_block | ( | bm::word_t * | block | ) |
| inline

Definition at line 222 of file bmalloc.h.

References bm::alloc_pool< BA, PA >::block_alloc_, bm::alloc_pool< BA, PA >::block_pool_, BM_ASSERT, IS_VALID_ADDR, bm::pointer_pool_array::push(), and bm::set_block_size.

## ◆ free_pools()

template<class BA , class PA >

void bm::alloc_pool< BA, PA >::free_pools | ( |  | ) |
| inline

Definition at line 229 of file bmalloc.h.

References bm::alloc_pool< BA, PA >::block_alloc_, bm::alloc_pool< BA, PA >::block_pool_, bm::pointer_pool_array::pop(), and bm::set_block_size.

Referenced by bm::alloc_pool< BA, PA >::~alloc_pool().

## Field Documentation

## ◆ block_alloc_

template<class BA , class PA >

BA bm::alloc_pool< BA, PA >::block_alloc_
| protected

Definition at line 242 of file bmalloc.h.

Referenced by bm::alloc_pool< BA, PA >::alloc_bit_block(), bm::alloc_pool< BA, PA >::free_bit_block(), and bm::alloc_pool< BA, PA >::free_pools().

## ◆ block_pool_

template<class BA , class PA >

pointer_pool_array bm::alloc_pool< BA, PA >::block_pool_
| protected

Definition at line 241 of file bmalloc.h.

Referenced by bm::alloc_pool< BA, PA >::alloc_bit_block(), bm::alloc_pool< BA, PA >::free_bit_block(), and bm::alloc_pool< BA, PA >::free_pools().

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

- bmalloc.h