38 Region::Pool::Pool(
void)
39 :
c(new Chunk), n_c(2U) {
40 c->next =
new Chunk;
c->next->next =
nullptr;
43 Region::Pool::chunk(
void) {
49 n =
c;
c =
c->next; n_c--;
51 n =
new Region::Chunk;
58 Region::Pool::chunk(Chunk*
u) {
67 Region::Pool::~Pool(
void) {
75 }
while (
c !=
nullptr);
78 Region::Pool& Region::pool(
void) {
79 static Region::Pool _p;
84 Region::heap_alloc(
size_t s) {
90 HeapInfo* h =
static_cast<HeapInfo*
>
91 (
heap.
ralloc(
sizeof(HeapInfo)+(4-1)*
sizeof(
void*)));
93 h->blocks[0]=hi; h->blocks[1]=
p;
97 if (h->n == h->size) {
98 HeapInfo*
n =
static_cast<HeapInfo*
>
99 (
heap.
ralloc(
sizeof(HeapInfo)+(2*h->n-1)*
sizeof(
void*)));
102 memcpy(&
n->blocks[0], &h->blocks[0], h->n*
sizeof(
void*));
107 h->blocks[h->n++] =
p;
113 Region::heap_free(
void) {
114 assert(hi !=
nullptr);
117 for (
unsigned int i=0U;
i<h->
n;
i++)
int p
Number of positive literals for node type.
union Gecode::@602::NNF::@65 u
Union depending on nodetype t.
int n
Number of negative literals for node type.
void rfree(void *p)
Free memory block starting at p.
void * ralloc(size_t s)
Allocate s bytes from heap.
Heap heap
The single global heap.
const unsigned int n_hc_cache
How many heap chunks should be cached at most.
void * unmark(void *p)
Return unmarked pointer for a marked pointer p.
void * mark(void *p)
Return marked pointer for unmarked pointer p.
bool marked(void *p)
Check whether p is marked.
Gecode::FloatVal c(-8, 8)
Gecode::IntArgs i({1, 2, 3, 4})