*** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@23 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5d1946922e
commit
0db00305af
3 changed files with 6 additions and 5 deletions
|
|
@ -9,8 +9,8 @@
|
||||||
# Set your C++ compiler here. g++ works on most machines,
|
# Set your C++ compiler here. g++ works on most machines,
|
||||||
# but you might have to change it depending on your installation.
|
# but you might have to change it depending on your installation.
|
||||||
#
|
#
|
||||||
CC = gcc
|
CC = cc -g
|
||||||
prefix = /home/beazley/SWIG1.2
|
prefix = /usr/local
|
||||||
|
|
||||||
# Comment out the following line if you're on an SGI or don't have ranlib!
|
# Comment out the following line if you're on an SGI or don't have ranlib!
|
||||||
RANLIB = ranlib
|
RANLIB = ranlib
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ static DOH *find_internal(DOH *co) {
|
||||||
s = 0;
|
s = 0;
|
||||||
while (r) {
|
while (r) {
|
||||||
s = r;
|
s = r;
|
||||||
// printf("checking %s\n", r->cstr);
|
/* printf("checking %s\n", r->cstr); */
|
||||||
d = strcmp(r->cstr,c);
|
d = strcmp(r->cstr,c);
|
||||||
if (d == 0) return r->sstr;
|
if (d == 0) return r->sstr;
|
||||||
if (d < 0) r = r->left;
|
if (d < 0) r = r->left;
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ int DohObjFreeCheck(DOH *ptr) {
|
||||||
void *DohObjMalloc(size_t size) {
|
void *DohObjMalloc(size_t size) {
|
||||||
Pool *p;
|
Pool *p;
|
||||||
Fragment *f;
|
Fragment *f;
|
||||||
void *ptr;
|
void *ptr = 0;
|
||||||
|
|
||||||
if (size > DOH_MAX_FRAG) return 0;
|
if (size > DOH_MAX_FRAG) return 0;
|
||||||
if (!pools_initialized) InitPools();
|
if (!pools_initialized) InitPools();
|
||||||
|
|
@ -149,7 +149,6 @@ void *DohObjMalloc(size_t size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No free fragments. See if the pool is large enough */
|
/* No free fragments. See if the pool is large enough */
|
||||||
|
|
||||||
if (size < (p->len - p->current)) {
|
if (size < (p->len - p->current)) {
|
||||||
ptr = (void *) (p->ptr + p->current);
|
ptr = (void *) (p->ptr + p->current);
|
||||||
p->current = (p->current + size + 7) & ~0x3;
|
p->current = (p->current + size + 7) & ~0x3;
|
||||||
|
|
@ -162,8 +161,10 @@ void *DohObjMalloc(size_t size) {
|
||||||
f->ptr = (p->ptr + p->current);
|
f->ptr = (p->ptr + p->current);
|
||||||
f->len = (p->len - p->current);
|
f->len = (p->len - p->current);
|
||||||
f->next = FreeFragments[f->len];
|
f->next = FreeFragments[f->len];
|
||||||
|
p->current = p->len;
|
||||||
FreeFragments[f->len] = f;
|
FreeFragments[f->len] = f;
|
||||||
}
|
}
|
||||||
|
|
||||||
p = CreatePool(_PoolSize);
|
p = CreatePool(_PoolSize);
|
||||||
p->next = Pools;
|
p->next = Pools;
|
||||||
Pools = p;
|
Pools = p;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue