Pool for blockwise memory allocation. More...

#include <pool.hh>

Classes

union  link
 

Public Member Functions

T * alloc ()
 Returns a pointer to a available location. More...
 
float memory () const
 
 Pool (unsigned sz=0)
 Constructor. More...
 
 ~Pool ()
 

Private Member Functions

void operator= (Pool &)
 
 Pool (Pool &)
 

Private Attributes

void * blk
 
const unsigned blkSz
 
unsigned free
 Stores the number of free entries. More...
 
T * next
 

Detailed Description

template<class T>
class concepts::Pool< T >

Pool for blockwise memory allocation.

A chunk of memory is allocated and returned piecewise. If all space is used up, new space is allocated.

Definition at line 23 of file pool.hh.

Constructor & Destructor Documentation

◆ Pool() [1/2]

template<class T >
concepts::Pool< T >::Pool ( Pool< T > &  )
private

◆ Pool() [2/2]

template<class T >
concepts::Pool< T >::Pool ( unsigned  sz = 0)
inline

Constructor.

Definition at line 42 of file pool.hh.

◆ ~Pool()

template<class T >
concepts::Pool< T >::~Pool

Definition at line 55 of file pool.hh.

Member Function Documentation

◆ alloc()

template<class T >
T * concepts::Pool< T >::alloc

Returns a pointer to a available location.

If needed, a new chunk is allocated.

Definition at line 63 of file pool.hh.

◆ memory()

template<class T >
float concepts::Pool< T >::memory

Definition at line 73 of file pool.hh.

◆ operator=()

template<class T >
void concepts::Pool< T >::operator= ( Pool< T > &  )
private

Member Data Documentation

◆ blk

template<class T >
void* concepts::Pool< T >::blk
private

Definition at line 30 of file pool.hh.

◆ blkSz

template<class T >
const unsigned concepts::Pool< T >::blkSz
private

Definition at line 29 of file pool.hh.

◆ free

template<class T >
unsigned concepts::Pool< T >::free
private

Stores the number of free entries.

Definition at line 33 of file pool.hh.

◆ next

template<class T >
T* concepts::Pool< T >::next
private

Definition at line 35 of file pool.hh.


The documentation for this class was generated from the following file:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich