diff --git a/Source/DOH/Doh/Makefile b/Source/DOH/Doh/Makefile index 7a1de04f0..562dc91cc 100644 --- a/Source/DOH/Doh/Makefile +++ b/Source/DOH/Doh/Makefile @@ -9,8 +9,8 @@ # Set your C++ compiler here. g++ works on most machines, # but you might have to change it depending on your installation. # -CC = gcc -prefix = /home/beazley/SWIG1.2 +CC = cc -g +prefix = /usr/local # Comment out the following line if you're on an SGI or don't have ranlib! RANLIB = ranlib diff --git a/Source/DOH/Doh/base.c b/Source/DOH/Doh/base.c index ed77e097c..cf2053c7a 100644 --- a/Source/DOH/Doh/base.c +++ b/Source/DOH/Doh/base.c @@ -93,7 +93,7 @@ static DOH *find_internal(DOH *co) { s = 0; while (r) { s = r; - // printf("checking %s\n", r->cstr); + /* printf("checking %s\n", r->cstr); */ d = strcmp(r->cstr,c); if (d == 0) return r->sstr; if (d < 0) r = r->left; diff --git a/Source/DOH/Doh/memory.c b/Source/DOH/Doh/memory.c index 4a4bd1590..9164bcf46 100644 --- a/Source/DOH/Doh/memory.c +++ b/Source/DOH/Doh/memory.c @@ -134,7 +134,7 @@ int DohObjFreeCheck(DOH *ptr) { void *DohObjMalloc(size_t size) { Pool *p; Fragment *f; - void *ptr; + void *ptr = 0; if (size > DOH_MAX_FRAG) return 0; if (!pools_initialized) InitPools(); @@ -149,7 +149,6 @@ void *DohObjMalloc(size_t size) { } /* No free fragments. See if the pool is large enough */ - if (size < (p->len - p->current)) { ptr = (void *) (p->ptr + p->current); p->current = (p->current + size + 7) & ~0x3; @@ -162,8 +161,10 @@ void *DohObjMalloc(size_t size) { f->ptr = (p->ptr + p->current); f->len = (p->len - p->current); f->next = FreeFragments[f->len]; + p->current = p->len; FreeFragments[f->len] = f; } + p = CreatePool(_PoolSize); p->next = Pools; Pools = p;