Generated on Sat May 25 2013 18:00:43 for Gecode by doxygen 1.8.3.1
Space-memory management

Namespaces

namespace  Gecode::MemoryConfig
 Parameters defining memory management policy for spaces.
 

Classes

class  Gecode::FreeList
 Base-class for freelist-managed objects. More...
 
class  Gecode::RangeList
 Lists of ranges (intervals) More...
 

Functions

template<class T >
T * Gecode::Space::alloc (long unsigned int n)
 Allocate block of n objects of type T from space heap. More...
 
template<class T >
T * Gecode::Space::alloc (long int n)
 Allocate block of n objects of type T from space heap. More...
 
template<class T >
T * Gecode::Space::alloc (unsigned int n)
 Allocate block of n objects of type T from space heap. More...
 
template<class T >
T * Gecode::Space::alloc (int n)
 Allocate block of n objects of type T from space heap. More...
 
template<class T >
void Gecode::Space::free (T *b, long unsigned int n)
 Delete n objects allocated from space heap starting at b. More...
 
template<class T >
void Gecode::Space::free (T *b, long int n)
 Delete n objects allocated from space heap starting at b. More...
 
template<class T >
void Gecode::Space::free (T *b, unsigned int n)
 Delete n objects allocated from space heap starting at b. More...
 
template<class T >
void Gecode::Space::free (T *b, int n)
 Delete n objects allocated from space heap starting at b. More...
 
template<class T >
T * Gecode::Space::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 space heap. More...
 
template<class T >
T * Gecode::Space::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 space heap. More...
 
template<class T >
T * Gecode::Space::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 space heap. More...
 
template<class T >
T * Gecode::Space::realloc (T *b, int n, int m)
 Reallocate block of n objects starting at b to m objects of type T from the space heap. More...
 
template<class T >
T ** Gecode::Space::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 the space heap. More...
 
template<class T >
T ** Gecode::Space::realloc (T **b, long int n, long int m)
 Reallocate block of n pointers starting at b to m objects of type T* from the space heap. More...
 
template<class T >
T ** Gecode::Space::realloc (T **b, unsigned int n, unsigned int m)
 Reallocate block of n pointers starting at b to m objects of type T* from the space heap. More...
 
template<class T >
T ** Gecode::Space::realloc (T **b, int n, int m)
 Reallocate block of n pointers starting at b to m objects of type T* from the space heap. More...
 
void * Gecode::Space::ralloc (size_t s)
 Allocate memory on space heap. More...
 
void Gecode::Space::rfree (void *p, size_t s)
 Free memory previously allocated with alloc (might be reused later) More...
 
void * Gecode::Space::rrealloc (void *b, size_t n, size_t m)
 Reallocate memory block starting at b from size n to size s. More...
 
template<size_t >
void * Gecode::Space::fl_alloc (void)
 Allocate from freelist-managed memory. More...
 
template<size_t >
void Gecode::Space::fl_dispose (FreeList *f, FreeList *l)
 Return freelist-managed memory to freelist. More...
 
size_t Gecode::Space::allocated (void) const
 Return how much heap memory is allocated. More...
 
void Gecode::Space::flush (void)
 Flush cached memory blocks. More...
 

Detailed Description

Function Documentation

template<class T >
T * Gecode::Space::alloc ( long unsigned int  n)
inline

Allocate block of n objects of type T from space heap.

Note that this function implements C++ semantics: the default constructor of T is run for all n objects.

Definition at line 2143 of file core.hpp.

template<class T >
T * Gecode::Space::alloc ( long int  n)
inline

Allocate block of n objects of type T from space heap.

Note that this function implements C++ semantics: the default constructor of T is run for all n objects.

Definition at line 2151 of file core.hpp.

template<class T >
T * Gecode::Space::alloc ( unsigned int  n)
inline

Allocate block of n objects of type T from space heap.

Note that this function implements C++ semantics: the default constructor of T is run for all n objects.

Definition at line 2157 of file core.hpp.

template<class T >
T * Gecode::Space::alloc ( int  n)
inline

Allocate block of n objects of type T from space heap.

Note that this function implements C++ semantics: the default constructor of T is run for all n objects.

Definition at line 2162 of file core.hpp.

template<class T >
void Gecode::Space::free ( T *  b,
long unsigned int  n 
)
inline

Delete n objects allocated from space heap 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, it is just scheduled for later reusal.

Definition at line 2169 of file core.hpp.

template<class T >
void Gecode::Space::free ( T *  b,
long int  n 
)
inline

Delete n objects allocated from space heap 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, it is just scheduled for later reusal.

Definition at line 2176 of file core.hpp.

template<class T >
void Gecode::Space::free ( T *  b,
unsigned int  n 
)
inline

Delete n objects allocated from space heap 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, it is just scheduled for later reusal.

Definition at line 2182 of file core.hpp.

template<class T >
void Gecode::Space::free ( T *  b,
int  n 
)
inline

Delete n objects allocated from space heap 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, it is just scheduled for later reusal.

Definition at line 2187 of file core.hpp.

template<class T >
T * Gecode::Space::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 the space heap.

Note that this function implements C++ semantics: the copy constructor of T is run for all $\min(n,m)$ objects, the default constructor of T is run for all remaining $\max(n,m)-\min(n,m)$ objects, and the destrucor of T is run for all n objects in b.

Returns the address of the new block.

Definition at line 2194 of file core.hpp.

template<class T >
T * Gecode::Space::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 the space heap.

Note that this function implements C++ semantics: the copy constructor of T is run for all $\min(n,m)$ objects, the default constructor of T is run for all remaining $\max(n,m)-\min(n,m)$ objects, and the destrucor of T is run for all n objects in b.

Returns the address of the new block.

Definition at line 2210 of file core.hpp.

template<class T >
T * Gecode::Space::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 the space heap.

Note that this function implements C++ semantics: the copy constructor of T is run for all $\min(n,m)$ objects, the default constructor of T is run for all remaining $\max(n,m)-\min(n,m)$ objects, and the destrucor of T is run for all n objects in b.

Returns the address of the new block.

Definition at line 2217 of file core.hpp.

template<class T >
T * Gecode::Space::realloc ( T *  b,
int  n,
int  m 
)
inline

Reallocate block of n objects starting at b to m objects of type T from the space heap.

Note that this function implements C++ semantics: the copy constructor of T is run for all $\min(n,m)$ objects, the default constructor of T is run for all remaining $\max(n,m)-\min(n,m)$ objects, and the destrucor of T is run for all n objects in b.

Returns the address of the new block.

Definition at line 2223 of file core.hpp.

template<class T >
T ** Gecode::Space::realloc ( T **  b,
long unsigned int  n,
long unsigned int  m 
)
inline

Reallocate block of n pointers starting at b to m objects of type T* from the space heap.

Returns the address of the new block.

This is a specialization for performance.

Definition at line 2272 of file core.hpp.

template<class T >
T ** Gecode::Space::realloc ( T **  b,
long int  n,
long int  m 
)
inline

Reallocate block of n pointers starting at b to m objects of type T* from the space heap.

Returns the address of the new block.

This is a specialization for performance.

Definition at line 2277 of file core.hpp.

template<class T >
T ** Gecode::Space::realloc ( T **  b,
unsigned int  n,
unsigned int  m 
)
inline

Reallocate block of n pointers starting at b to m objects of type T* from the space heap.

Returns the address of the new block.

This is a specialization for performance.

Definition at line 2284 of file core.hpp.

template<class T >
T ** Gecode::Space::realloc ( T **  b,
int  n,
int  m 
)
inline

Reallocate block of n pointers starting at b to m objects of type T* from the space heap.

Returns the address of the new block.

This is a specialization for performance.

Definition at line 2290 of file core.hpp.

void * Gecode::Space::ralloc ( size_t  s)
inline

Allocate memory on space heap.

Definition at line 2097 of file core.hpp.

void Gecode::Space::rfree ( void *  p,
size_t  s 
)
inline

Free memory previously allocated with alloc (might be reused later)

Definition at line 2101 of file core.hpp.

void * Gecode::Space::rrealloc ( void *  b,
size_t  n,
size_t  m 
)
inline

Reallocate memory block starting at b from size n to size s.

Definition at line 2105 of file core.hpp.

template<size_t s>
void * Gecode::Space::fl_alloc ( void  )
inline

Allocate from freelist-managed memory.

Definition at line 2120 of file core.hpp.

template<size_t s>
void Gecode::Space::fl_dispose ( FreeList f,
FreeList l 
)
inline

Return freelist-managed memory to freelist.

The first list element to be retuned is f, the last is l.

Definition at line 2125 of file core.hpp.

size_t Gecode::Space::allocated ( void  ) const
inline

Return how much heap memory is allocated.

Note that is includes both the memory allocated for the space heap as well as additional memory allocated by actors.

Definition at line 2130 of file core.hpp.

void Gecode::Space::flush ( void  )

Flush cached memory blocks.

All spaces that are obtained as non-shared clones from some same space try to cache memory blocks from failed spaces. To minimize memory consumption, these blocks can be flushed.

Definition at line 150 of file core.cpp.