Handle to region. More...
#include <region.hpp>
Public Member Functions | |
Region (void) | |
Initialize region. More... | |
void | free (void) |
Free allocate memory. More... | |
~Region (void) | |
Return memory. More... | |
Typed allocation routines | |
template<class T > | |
T * | alloc (long unsigned int n) |
Allocate block of n objects of type T from region. More... | |
template<class T > | |
T * | alloc (long int n) |
Allocate block of n objects of type T from region. More... | |
template<class T > | |
T * | alloc (unsigned int n) |
Allocate block of n objects of type T from region. More... | |
template<class T > | |
T * | alloc (int n) |
Allocate block of n objects of type T from region. More... | |
template<class T > | |
void | free (T *b, long unsigned int n) |
Delete n objects allocated from the region starting at b. More... | |
template<class T > | |
void | free (T *b, long int n) |
Delete n objects allocated from the region starting at b. More... | |
template<class T > | |
void | free (T *b, unsigned int n) |
Delete n objects allocated from the region starting at b. More... | |
template<class T > | |
void | free (T *b, int n) |
Delete n objects allocated from the region starting at b. More... | |
template<class T > | |
T * | realloc (T *b, long unsigned int n, long unsigned int m) |
Reallocate block of n objects starting at b to m objects of type T from the region. More... | |
template<class T > | |
T * | realloc (T *b, long int n, long int m) |
Reallocate block of n objects starting at b to m objects of type T from the region. More... | |
template<class T > | |
T * | realloc (T *b, unsigned int n, unsigned int m) |
Reallocate block of n objects starting at b to m objects of type T from the region. More... | |
template<class T > | |
T * | realloc (T *b, int n, int m) |
Reallocate block of n objects starting at b to m objects of type T from the region. More... | |
Raw allocation routines | |
void * | ralloc (size_t s) |
Allocate memory from region. More... | |
void | rfree (void *p, size_t s) |
Free memory previously allocated. More... | |
Construction routines | |
template<class T > | |
T & | construct (void) |
Constructs a single object of type T from region using the default constructor. More... | |
template<class T , typename A1 > | |
T & | construct (A1 const &a1) |
Constructs a single object of type T from region using a unary constructor. More... | |
template<class T , typename A1 , typename A2 > | |
T & | construct (A1 const &a1, A2 const &a2) |
Constructs a single object of type T from region using a binary constructor. More... | |
template<class T , typename A1 , typename A2 , typename A3 > | |
T & | construct (A1 const &a1, A2 const &a2, A3 const &a3) |
Constructs a single object of type T from region using a ternary constructor. More... | |
template<class T , typename A1 , typename A2 , typename A3 , typename A4 > | |
T & | construct (A1 const &a1, A2 const &a2, A3 const &a3, A4 const &a4) |
Constructs a single object of type T from region using a quaternary constructor. More... | |
template<class T , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 > | |
T & | construct (A1 const &a1, A2 const &a2, A3 const &a3, A4 const &a4, A5 const &a5) |
Constructs a single object of type T from region using a quinary constructor. More... | |
Handle to region.
Definition at line 57 of file region.hpp.
|
inline |
Initialize region.
Definition at line 350 of file region.hpp.
|
inline |
Return memory.
Definition at line 371 of file region.hpp.
|
inline |
Free allocate memory.
Note that in fact not all memory is freed, memory that has been allocated for large allocation requests will not be freed.
Definition at line 354 of file region.hpp.
|
inline |
Allocate block of n objects of type T from region.
Note that this function implements C++ semantics: the default constructor of T is run for all n objects.
Definition at line 384 of file region.hpp.
|
inline |
Allocate block of n objects of type T from region.
Note that this function implements C++ semantics: the default constructor of T is run for all n objects.
Definition at line 392 of file region.hpp.
|
inline |
Allocate block of n objects of type T from region.
Note that this function implements C++ semantics: the default constructor of T is run for all n objects.
Definition at line 398 of file region.hpp.
|
inline |
Allocate block of n objects of type T from region.
Note that this function implements C++ semantics: the default constructor of T is run for all n objects.
Definition at line 403 of file region.hpp.
|
inline |
Delete n objects allocated from the region starting at b.
Note that this function implements C++ semantics: the destructor of T is run for all n objects.
Note that the memory is not freed, the only effect is running the destructors.
Definition at line 410 of file region.hpp.
|
inline |
Delete n objects allocated from the region starting at b.
Note that this function implements C++ semantics: the destructor of T is run for all n objects.
Note that the memory is not freed, the only effect is running the destructors.
Definition at line 417 of file region.hpp.
|
inline |
Delete n objects allocated from the region starting at b.
Note that this function implements C++ semantics: the destructor of T is run for all n objects.
Note that the memory is not freed, the only effect is running the destructors.
Definition at line 423 of file region.hpp.
|
inline |
Delete n objects allocated from the region starting at b.
Note that this function implements C++ semantics: the destructor of T is run for all n objects.
Note that the memory is not freed, the only effect is running the destructors.
Definition at line 428 of file region.hpp.
|
inline |
Reallocate block of n objects starting at b to m objects of type T from the region.
Note that this function implements C++ semantics: the copy constructor of T is run for all objects, the default constructor of T is run for all remaining
objects, and the destrucor of T is run for all n objects in b.
Returns the address of the new block.
Definition at line 435 of file region.hpp.
|
inline |
Reallocate block of n objects starting at b to m objects of type T from the region.
Note that this function implements C++ semantics: the copy constructor of T is run for all objects, the default constructor of T is run for all remaining
objects, and the destrucor of T is run for all n objects in b.
Returns the address of the new block.
Definition at line 451 of file region.hpp.
|
inline |
Reallocate block of n objects starting at b to m objects of type T from the region.
Note that this function implements C++ semantics: the copy constructor of T is run for all objects, the default constructor of T is run for all remaining
objects, and the destrucor of T is run for all n objects in b.
Returns the address of the new block.
Definition at line 458 of file region.hpp.
|
inline |
Reallocate block of n objects starting at b to m objects of type T from the region.
Note that this function implements C++ semantics: the copy constructor of T is run for all objects, the default constructor of T is run for all remaining
objects, and the destrucor of T is run for all n objects in b.
Returns the address of the new block.
Definition at line 464 of file region.hpp.
|
inline |
Allocate memory from region.
Definition at line 359 of file region.hpp.
|
inline |
Free memory previously allocated.
Note that the memory is only guaranteed to be freed after the region object itself gets deleted.
Definition at line 368 of file region.hpp.
|
inline |
Constructs a single object of type T from region using the default constructor.
Definition at line 476 of file region.hpp.
|
inline |
Constructs a single object of type T from region using a unary constructor.
The parameter is passed as a const reference.
Definition at line 481 of file region.hpp.
|
inline |
Constructs a single object of type T from region using a binary constructor.
The parameters are passed as const references.
Definition at line 488 of file region.hpp.
|
inline |
Constructs a single object of type T from region using a ternary constructor.
The parameters are passed as const references.
Definition at line 495 of file region.hpp.
|
inline |
Constructs a single object of type T from region using a quaternary constructor.
The parameters are passed as const references.
Definition at line 502 of file region.hpp.
|
inline |
Constructs a single object of type T from region using a quinary constructor.
The parameters are passed as const references.
Definition at line 509 of file region.hpp.