BitMagic-C++
Public Types | Public Member Functions | Protected Attributes
bm::alloc_pool< BA, PA > Class Template Reference

Allocation pool object. More...

#include <bmalloc.h>

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

Public Types

typedef BA block_allocator_type
 
typedef PA ptr_allocator_type
 

Public Member Functions

 alloc_pool ()
 
 ~alloc_pool ()
  More...
 
void set_block_limit (size_t limit) BMNOEXCEPT
  More...
 
bm::word_talloc_bit_block ()
  More...
 
void free_bit_block (bm::word_t *block) BMNOEXCEPT
  More...
 
void free_pools () BMNOEXCEPT
  More...
 
unsigned size () const BMNOEXCEPT
 return stack size More...
 

Protected Attributes

pointer_pool_array block_pool_
  More...
 
BA block_alloc_
  More...
 
size_t block_limit_ = 0
 soft limit for the pool of blocks More...
 

Detailed Description

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

Allocation pool object.

Examples
sample6.cpp.

Definition at line 223 of file bmalloc.h.

Member Function Documentation

◆ alloc_bit_block()

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

◆ free_bit_block()

template<class BA , class PA >
void bm::alloc_pool< BA, PA >::free_bit_block ( bm::word_t block)
inline

◆ free_pools()

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

◆ set_block_limit()

template<class BA , class PA >
void bm::alloc_pool< BA, PA >::set_block_limit ( size_t  limit)
inline

Definition at line 234 of file bmalloc.h.

References bm::alloc_pool< BA, PA >::block_limit_.

◆ size()

template<class BA , class PA >
unsigned bm::alloc_pool< BA, PA >::size ( ) const
inline

return stack size

Definition at line 273 of file bmalloc.h.

References bm::alloc_pool< BA, PA >::block_pool_, and bm::pointer_pool_array::size().

Field Documentation

◆ block_alloc_

template<class BA , class PA >
BA bm::alloc_pool< BA, PA >::block_alloc_
protected

◆ block_limit_

template<class BA , class PA >
size_t bm::alloc_pool< BA, PA >::block_limit_ = 0
protected

soft limit for the pool of blocks

Definition at line 278 of file bmalloc.h.

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

◆ block_pool_

template<class BA , class PA >
pointer_pool_array bm::alloc_pool< BA, PA >::block_pool_
protected

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