Gecode::Heap Class Reference
[%Heap memory management]
Heap memory management class More...
#include <heap.hpp>
Public Member Functions | |
Heap (void) | |
Default constructor (ensuring that only a single instance is created). | |
Typed allocation routines | |
| |
template<class T > | |
T * | alloc (long unsigned int n) |
Allocate block of n objects of type T from heap. | |
template<class T > | |
T * | alloc (long int n) |
Allocate block of n objects of type T from heap. | |
template<class T > | |
T * | alloc (unsigned int n) |
Allocate block of n objects of type T from heap. | |
template<class T > | |
T * | alloc (int n) |
Allocate block of n objects of type T from heap. | |
template<class T > | |
void | free (T *b, long unsigned int n) |
Delete n objects starting at b. | |
template<class T > | |
void | free (T *b, long int n) |
Delete n objects starting at b. | |
template<class T > | |
void | free (T *b, unsigned int n) |
Delete n objects starting at b. | |
template<class T > | |
void | free (T *b, int n) |
Delete n objects starting at b. | |
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 heap. | |
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 heap. | |
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 heap. | |
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 heap. | |
template<class T > | |
T ** | realloc (T **b, long unsigned int n, long unsigned int m) |
Reallocate block of n pointers starting at b to m objects of type T* from heap. | |
template<class T > | |
T ** | realloc (T **b, long int n, long int m) |
Reallocate block of n pointers starting at b to m objects of type T* from heap. | |
template<class T > | |
T ** | realloc (T **b, unsigned int n, unsigned int m) |
Reallocate block of n pointers starting at b to m objects of type T* from heap. | |
template<class T > | |
T ** | realloc (T **b, int n, int m) |
Reallocate block of n pointers starting at b to m objects of type T* from heap. | |
template<class T > | |
static T * | copy (T *d, const T *s, long unsigned int n) |
Copy n objects starting at s to d. | |
template<class T > | |
static T * | copy (T *d, const T *s, long int n) |
Copy n objects starting at s to d. | |
template<class T > | |
static T * | copy (T *d, const T *s, unsigned int n) |
Copy n objects starting at s to d. | |
template<class T > | |
static T * | copy (T *d, const T *s, int n) |
Copy n objects starting at s to d. | |
template<class T > | |
static T ** | copy (T **d, const T **s, long unsigned int n) |
Copy n pointers starting at s to d. | |
template<class T > | |
static T ** | copy (T **d, const T **s, long int n) |
Copy n pointers starting at s to d. | |
template<class T > | |
static T ** | copy (T **d, const T **s, unsigned int n) |
Copy n pointers starting at s to d. | |
template<class T > | |
static T ** | copy (T **d, const T **s, int n) |
Copy n pointers starting at s to d. | |
Raw allocation routines | |
| |
void * | ralloc (size_t s) |
Allocate s bytes from heap. | |
void | rfree (void *p) |
Free memory block starting at p. | |
void | rfree (void *p, size_t s) |
Free memory block starting at p with size s. | |
void * | rrealloc (void *p, size_t s) |
Change memory block starting at p to size s. |
Detailed Description
Heap memory management class
All routines throw an exception of MemoryExhausted, if a request cannot be fulfilled.
Definition at line 66 of file heap.hpp.
Constructor & Destructor Documentation
Gecode::Heap::Heap | ( | void | ) |
Member Function Documentation
T * Gecode::Heap::alloc | ( | long unsigned int | n | ) | [inline] |
T * Gecode::Heap::alloc | ( | long int | n | ) | [inline] |
T * Gecode::Heap::alloc | ( | unsigned int | n | ) | [inline] |
T * Gecode::Heap::alloc | ( | int | n | ) | [inline] |
void Gecode::Heap::free | ( | T * | b, | |
long unsigned int | n | |||
) | [inline] |
void Gecode::Heap::free | ( | T * | b, | |
long int | n | |||
) | [inline] |
void Gecode::Heap::free | ( | T * | b, | |
unsigned int | n | |||
) | [inline] |
void Gecode::Heap::free | ( | T * | b, | |
int | n | |||
) | [inline] |
T * Gecode::Heap::realloc | ( | T * | b, | |
long unsigned int | n, | |||
long unsigned int | m | |||
) | [inline] |
Reallocate block of n objects starting at b to m objects of type T from heap.
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.
T * Gecode::Heap::realloc | ( | T * | b, | |
long int | n, | |||
long int | m | |||
) | [inline] |
Reallocate block of n objects starting at b to m objects of type T from heap.
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.
T * Gecode::Heap::realloc | ( | T * | b, | |
unsigned int | n, | |||
unsigned int | m | |||
) | [inline] |
Reallocate block of n objects starting at b to m objects of type T from heap.
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.
T * Gecode::Heap::realloc | ( | T * | b, | |
int | n, | |||
int | m | |||
) | [inline] |
Reallocate block of n objects starting at b to m objects of type T from heap.
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.
T ** Gecode::Heap::realloc | ( | T ** | b, | |
long unsigned int | n, | |||
long unsigned int | m | |||
) | [inline] |
T ** Gecode::Heap::realloc | ( | T ** | b, | |
long int | n, | |||
long int | m | |||
) | [inline] |
T ** Gecode::Heap::realloc | ( | T ** | b, | |
unsigned int | n, | |||
unsigned int | m | |||
) | [inline] |
T ** Gecode::Heap::realloc | ( | T ** | b, | |
int | n, | |||
int | m | |||
) | [inline] |
T * Gecode::Heap::copy | ( | T * | d, | |
const T * | s, | |||
long unsigned int | n | |||
) | [inline, static] |
T * Gecode::Heap::copy | ( | T * | d, | |
const T * | s, | |||
long int | n | |||
) | [inline, static] |
T * Gecode::Heap::copy | ( | T * | d, | |
const T * | s, | |||
unsigned int | n | |||
) | [inline, static] |
T * Gecode::Heap::copy | ( | T * | d, | |
const T * | s, | |||
int | n | |||
) | [inline, static] |
T ** Gecode::Heap::copy | ( | T ** | d, | |
const T ** | s, | |||
long unsigned int | n | |||
) | [inline, static] |
T ** Gecode::Heap::copy | ( | T ** | d, | |
const T ** | s, | |||
long int | n | |||
) | [inline, static] |
T ** Gecode::Heap::copy | ( | T ** | d, | |
const T ** | s, | |||
unsigned int | n | |||
) | [inline, static] |
T ** Gecode::Heap::copy | ( | T ** | d, | |
const T ** | s, | |||
int | n | |||
) | [inline, static] |
void * Gecode::Heap::ralloc | ( | size_t | s | ) | [inline] |
void Gecode::Heap::rfree | ( | void * | p | ) | [inline] |
void Gecode::Heap::rfree | ( | void * | p, | |
size_t | s | |||
) | [inline] |
void * Gecode::Heap::rrealloc | ( | void * | p, | |
size_t | s | |||
) | [inline] |
The documentation for this class was generated from the following files:
- gecode/support/heap.hpp (Revision: 14972)
- gecode/support/heap.cpp (Revision: 14964)