69 bool alloc(
size_t s,
void*&
p);
137 T*
alloc(
long unsigned int n);
172 void free(T*
b,
long unsigned int n);
183 void free(T*
b,
long int n);
194 void free(T*
b,
unsigned int n);
218 T*
realloc(T*
b,
long unsigned int n,
long unsigned int m);
231 T*
realloc(T*
b,
long int n,
long int m);
244 T*
realloc(T*
b,
unsigned int n,
unsigned int m);
269 void rfree(
void*
p,
size_t s);
283 template<
class T,
typename A1>
290 template<
class T,
typename A1,
typename A2>
291 T&
construct(A1
const& a1, A2
const& a2);
297 template<
class T,
typename A1,
typename A2,
typename A3>
298 T&
construct(A1
const& a1, A2
const& a2, A3
const& a3);
304 template<
class T,
typename A1,
typename A2,
typename A3,
typename A4>
305 T&
construct(A1
const& a1, A2
const& a2, A3
const& a3, A4
const& a4);
311 template<
class T,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
312 T&
construct(A1
const& a1, A2
const& a2, A3
const& a3, A4
const& a4, A5
const& a5);
318 static void*
operator new(
size_t s)
throw() { (void) s;
return NULL; }
320 static void operator delete(
void*
p) { (void)
p; };
324 const Region& operator =(
const Region&) {
return *
this; }
334 Region::Chunk::alloc(
size_t s,
void*&
p) {
346 Region::Chunk::reset(
void) {
353 : chunk(pool().chunk()), hi(0) {}
363 if (chunk->alloc(s,
p))
366 return heap_alloc(s);
387 T*
p =
static_cast<T*
>(
ralloc(
sizeof(T)*
n));
388 for (
long unsigned int i=0U; i<
n; i++)
389 (
void)
new (
p+i) T();
396 return alloc<T>(
static_cast<long unsigned int>(
n));
401 return alloc<T>(
static_cast<long unsigned int>(
n));
407 return alloc<T>(
static_cast<long unsigned int>(
n));
413 for (
long unsigned int i=0U; i<
n; i++)
421 free<T>(
b,
static_cast<long unsigned int>(
n));
426 free<T>(
b,
static_cast<long unsigned int>(
n));
432 free<T>(
b,
static_cast<long unsigned int>(
n));
439 T*
p =
static_cast<T*
>(
ralloc(
sizeof(T)*m));
440 for (
long unsigned int i=0U; i<
n; i++)
441 (
void)
new (
p+i) T(
b[i]);
442 for (
long unsigned int i=
n; i<m; i++)
443 (
void)
new (
p+i) T();
454 assert((
n >= 0) && (m >= 0));
456 static_cast<long unsigned int>(m));
462 static_cast<long unsigned int>(m));
467 assert((
n >= 0) && (m >= 0));
469 static_cast<long unsigned int>(m));
481 template<
class T,
typename A1>
484 T&
t = *
static_cast<T*
>(
ralloc(
sizeof(T)));
488 template<
class T,
typename A1,
typename A2>
491 T&
t = *
static_cast<T*
>(
ralloc(
sizeof(T)));
495 template<
class T,
typename A1,
typename A2,
typename A3>
498 T&
t = *
static_cast<T*
>(
ralloc(
sizeof(T)));
499 new (&
t) T(a1,a2,a3);
502 template<
class T,
typename A1,
typename A2,
typename A3,
typename A4>
505 T&
t = *
static_cast<T*
>(
ralloc(
sizeof(T)));
506 new (&
t) T(a1,a2,a3,a4);
509 template<
class T,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
512 T&
t = *
static_cast<T*
>(
ralloc(
sizeof(T)));
513 new (&
t) T(a1,a2,a3,a4,a5);
struct Gecode::@603::NNF::@65::@66 b
For binary nodes (and, or, eqv)
union Gecode::@603::NNF::@65 u
Union depending on nodetype t.
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
Base class for heap allocated objects.
void * ralloc(size_t s)
Allocate memory from region.
void free(void)
Free allocate memory.
T & construct(void)
Constructs a single object of type T from region using the default constructor.
Region(void)
Initialize 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.
~Region(void)
Return memory.
void rfree(void *p, size_t s)
Free memory previously allocated.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
A mutex for mutual exclausion among several threads.
#define GECODE_MEMORY_ALIGNMENT
Memory alignment.
#define GECODE_KERNEL_EXPORT
void align(size_t &s, size_t a=GECODE_MEMORY_ALIGNMENT)
Align size s to the required alignment a.
const size_t region_area_size
Size of region area.
Gecode toplevel namespace
T ptr_cast(void *p)
Cast p into pointer of type T.