101 T*
alloc(
long unsigned int n);
136 void free(T*
b,
long unsigned int n);
147 void free(T*
b,
long int n);
158 void free(T*
b,
unsigned int n);
182 T*
realloc(T*
b,
long unsigned int n,
long unsigned int m);
195 T*
realloc(T*
b,
long int n,
long int m);
208 T*
realloc(T*
b,
unsigned int n,
unsigned int m);
233 void rfree(
void*
p,
size_t s);
247 template<
class T,
typename A1>
254 template<
class T,
typename A1,
typename A2>
255 T&
construct(A1
const& a1, A2
const& a2);
261 template<
class T,
typename A1,
typename A2,
typename A3>
262 T&
construct(A1
const& a1, A2
const& a2, A3
const& a3);
268 template<
class T,
typename A1,
typename A2,
typename A3,
typename A4>
269 T&
construct(A1
const& a1, A2
const& a2, A3
const& a3, A4
const& a4);
275 template<
class T,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
276 T&
construct(A1
const& a1, A2
const& a2, A3
const& a3, A4
const& a4, A5
const& a5);
282 static void*
operator new(
size_t s)
throw() { (void) s;
return NULL; }
284 static void operator delete(
void*
p) { (void)
p; };
288 const Region& operator =(
const Region&) {
return *
this; }
299 : home(const_cast<
Space&>(h)), free_reset(home.sm->region.free), hi(0) {}
306 return heap_alloc(s);
314 home.sm->region.
free = free_reset;
327 T*
p =
static_cast<T*
>(
ralloc(
sizeof(T)*n));
328 for (
long unsigned int i=n;
i--; )
329 (
void)
new (p+
i) T();
336 return alloc<T>(
static_cast<long unsigned int>(
n));
341 return alloc<T>(
static_cast<long unsigned int>(
n));
347 return alloc<T>(
static_cast<long unsigned int>(
n));
353 for (
long unsigned int i=n;
i--; )
355 rfree(b,n*
sizeof(T));
361 free<T>(
b,
static_cast<long unsigned int>(
n));
366 free<T>(
b,
static_cast<long unsigned int>(
n));
372 free<T>(
b,
static_cast<long unsigned int>(
n));
379 T*
p =
static_cast<T*
>(
ralloc(
sizeof(T)*m));
380 for (
long unsigned int i=n;
i--; )
381 (
void)
new (p+
i) T(b[
i]);
382 for (
long unsigned int i=n; i<m; i++)
383 (
void)
new (p+
i) T();
394 assert((n >= 0) && (m >= 0));
395 return realloc<T>(
b,
static_cast<long unsigned int>(
n),
396 static_cast<long unsigned int>(m));
401 return realloc<T>(
b,
static_cast<long unsigned int>(
n),
402 static_cast<long unsigned int>(m));
407 assert((n >= 0) && (m >= 0));
408 return realloc<T>(
b,
static_cast<long unsigned int>(
n),
409 static_cast<long unsigned int>(m));
421 template<
class T,
typename A1>
424 T&
t = *
static_cast<T*
>(
ralloc(
sizeof(T)));
428 template<
class T,
typename A1,
typename A2>
431 T&
t = *
static_cast<T*
>(
ralloc(
sizeof(T)));
435 template<
class T,
typename A1,
typename A2,
typename A3>
438 T&
t = *
static_cast<T*
>(
ralloc(
sizeof(T)));
439 new (&
t) T(a1,a2,a3);
442 template<
class T,
typename A1,
typename A2,
typename A3,
typename A4>
445 T&
t = *
static_cast<T*
>(
ralloc(
sizeof(T)));
446 new (&
t) T(a1,a2,a3,a4);
449 template<
class T,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
452 T&
t = *
static_cast<T*
>(
ralloc(
sizeof(T)));
453 new (&
t) T(a1,a2,a3,a4,a5);
void rfree(void *p, size_t s)
Free memory previously allocated.
T & construct(void)
Constructs a single object of type T from region using the default constructor.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
~Region(void)
Return memory.
bool region_alloc(size_t s, void *&p)
Return memory chunk if available.
Region(const Space &home)
Initialize region from space.
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
unsigned int size(I &i)
Size of all ranges of range iterator i.
#define GECODE_KERNEL_EXPORT
void free(T *b, long unsigned int n)
Delete n objects allocated from the region starting at b.
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
Gecode toplevel namespace
size_t free
Amount of free memory.
void * ralloc(size_t s)
Allocate memory from region.
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.