42 Region::Pool::Pool(
void)
43 :
c(new Chunk), n_c(2U) {
44 c->next =
new Chunk;
c->next->next =
nullptr;
47 Region::Pool::chunk(
void) {
52 n =
c;
c =
c->next; n_c--;
54 n =
new Region::Chunk;
61 Region::Pool::chunk(Chunk*
u) {
71 Region::Pool::~Pool(
void) {
79 }
while (
c !=
nullptr);
83 Region::Pool& Region::pool(
void) {
84 static Region::Pool _p;
89 Region::heap_alloc(
size_t s) {
95 HeapInfo* h =
static_cast<HeapInfo*
> 96 (
heap.
ralloc(
sizeof(HeapInfo)+(4-1)*
sizeof(
void*)));
98 h->blocks[0]=hi; h->blocks[1]=
p;
102 if (h->n == h->size) {
103 HeapInfo* n =
static_cast<HeapInfo*
> 104 (
heap.
ralloc(
sizeof(HeapInfo)+(2*h->n-1)*
sizeof(
void*)));
107 memcpy(&n->blocks[0], &h->blocks[0], h->n*
sizeof(
void*));
112 h->blocks[h->n++] =
p;
118 Region::heap_free(
void) {
119 assert(hi !=
nullptr);
122 for (
unsigned int i=h->
n;
i--; )
bool marked(void *p)
Check whether p is marked.
void rfree(void *p)
Free memory block starting at p.
void * ralloc(size_t s)
Allocate s bytes from heap.
void * mark(void *p)
Return marked pointer for unmarked pointer p.
Gecode::FloatVal c(-8, 8)
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.
union Gecode::@585::NNF::@62 u
Union depending on nodetype t.
void * unmark(void *p)
Return unmarked pointer for a marked pointer p.
Heap heap
The single global heap.
const unsigned int n_hc_cache
How many heap chunks should be cached at most.
Gecode toplevel namespace