2
This software may only be used by you under license from AT&T Corp.
3
("AT&T"). A copy of AT&T's Source Code Agreement is available at
4
AT&T's Internet website having the URL:
5
<http://www.research.att.com/sw/tools/graphviz/license/source.html>
6
If you received this software without first entering into a license
7
with AT&T, you have an infringing copy of this software and cannot use
8
it without violating AT&T's intellectual property rights.
13
/* #include <vmalloc.h> */
22
freeinit(Freelist *fl, int size)
26
fl -> nodesize = size;
27
if (fl->blocklist != NULL) {
37
fl -> blocklist = NULL;
41
myalloc(unsigned int n)
45
if ((t=malloc(n)) == NULL) {
46
fprintf(stderr, "Insufficient memory\n");
59
if(fl->head == NULL) {
60
int size = fl->nodesize;
62
mem = myalloc(sizeof(Freeblock*) + sqrt_nsites * size);
63
cp = ((char*)mem) + sizeof(Freeblock*);
64
for(i=0; i<sqrt_nsites; i++) {
65
makefree(cp + i*size, fl);
67
mem->next = fl->blocklist;
71
fl -> head = t -> nextfree;
76
makefree(void *curr, Freelist *fl)
78
((Freenode*)curr) -> nextfree = fl -> head;
79
fl -> head = (Freenode*)curr;
83
void *getheap(Heap *hp, int sz)
90
if (sz > hp->size) size = sz;
92
blp = myalloc(sizeof(Heapblock*) + size);
93
hp->head = ((char*)blp) + sizeof(Heapblock*);
95
blp->next = hp->blocklist;
105
void heapinit(Heap *hp, int size)
110
if (hp->blocklist != NULL) {
120
hp -> blocklist = NULL;