Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0
Gecode::Support::BlockAllocator< T, A, blocksize > Class Template Reference

Manage memory organized into block lists (allocator) More...

#include <block-allocator.hpp>

Public Member Functions

 BlockAllocator (A &a)
 Initialize.
 
 ~BlockAllocator (void)
 Free all allocated blocks.
 
A & allocator (void)
 Return allocator used.
 
T * operator() (void)
 Return memory of size required by T.
 
size_t size (void) const
 Return size of memory required by allocator.
 

Detailed Description

template<class T, class A, int blocksize = 512>
class Gecode::Support::BlockAllocator< T, A, blocksize >

Manage memory organized into block lists (allocator)

The allocation policy is to free all memory allocated when the block allocator is deleted.

Definition at line 45 of file block-allocator.hpp.

Constructor & Destructor Documentation

◆ BlockAllocator()

template<class T , class A , int blocksize>
Gecode::Support::BlockAllocator< T, A, blocksize >::BlockAllocator ( A & a)
inline

Initialize.

Definition at line 98 of file block-allocator.hpp.

◆ ~BlockAllocator()

template<class T , class A , int blocksize>
Gecode::Support::BlockAllocator< T, A, blocksize >::~BlockAllocator ( void )
inline

Free all allocated blocks.

Definition at line 107 of file block-allocator.hpp.

Member Function Documentation

◆ allocator()

template<class T , class A , int blocksize>
A & Gecode::Support::BlockAllocator< T, A, blocksize >::allocator ( void )
inline

Return allocator used.

Definition at line 116 of file block-allocator.hpp.

◆ operator()()

template<class T , class A , int blocksize>
T * Gecode::Support::BlockAllocator< T, A, blocksize >::operator() ( void )
inline

Return memory of size required by T.

Definition at line 122 of file block-allocator.hpp.

◆ size()

template<class T , class A , int blocksize>
size_t Gecode::Support::BlockAllocator< T, A, blocksize >::size ( void ) const
inline

Return size of memory required by allocator.

Definition at line 141 of file block-allocator.hpp.


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