43 Region::heap_alloc(
size_t s) {
49 HeapInfo* h =
static_cast<HeapInfo*
>
50 (
heap.
ralloc(
sizeof(HeapInfo)+(4-1)*
sizeof(
void*)));
52 h->blocks[0]=hi; h->blocks[1]=
p;
56 if (h->n == h->size) {
57 HeapInfo*
n =
static_cast<HeapInfo*
>
58 (
heap.
ralloc(
sizeof(HeapInfo)+(2*h->n-1)*
sizeof(
void*)));
61 memcpy(&n->blocks[0], &h->blocks[0], h->n*
sizeof(
void*));
65 h->blocks[h->n++] =
p;
71 Region::heap_free(
void) {
75 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 p.
Heap heap
The single global heap.
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.
void * unmark(void *p)
Return unmarked pointer for a marked pointer p.
Gecode toplevel namespace