*** empty log message ***

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@19 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 1999-08-18 21:40:29 +00:00
commit 155cfdc73a
6 changed files with 23 additions and 15 deletions

View file

@ -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/Projects
CC = cc
prefix = /usr/local
# Comment out the following line if you're on an SGI or don't have ranlib!
RANLIB = ranlib

View file

@ -172,9 +172,9 @@ int
File_read(DOH *so, void *buffer, int len) {
File *s = (File *) so;
if (s->filep)
return (size_t) fread(buffer,1,len,s->filep);
return fread(buffer,1,len,s->filep);
else
return (size_t) read(s->fd,buffer,len);
return read(s->fd,buffer,len);
}
/* -----------------------------------------------------------------------------
@ -186,9 +186,9 @@ int
File_write(DOH *so, void *buffer, int len) {
File *s = (File *) so;
if (s->filep)
return (size_t) fwrite(buffer,1,len,s->filep);
return fwrite(buffer,1,len,s->filep);
else
return (size_t) write(s->fd,buffer,len);
return write(s->fd, buffer, len);
}
/* -----------------------------------------------------------------------------

View file

@ -324,7 +324,7 @@ int DohCopyto(DOH *in, DOH *out) {
cw = buffer;
while (nwrite) {
wret = Write(out,cw,nwrite);
if (wret < 0) return nbytes;
if (wret < 0) return -1;
nwrite = nwrite - wret;
cw += wret;
}

View file

@ -343,7 +343,7 @@ List_dump(DOH *lo, DOH *out) {
List *l = (List *) lo;
for (i = 0; i < l->nitems; i++) {
ret = Dump(l->items[i],out);
if (ret < 0) return -1;
if (ret < 0) ret;
nsent += ret;
}
return nsent;

View file

@ -23,8 +23,9 @@
#define DOH_MAX_FRAG 1024
#endif
int _DohMemoryCurrent = 0;
int _DohMemoryHigh = 0;
static int _DohMemoryCurrent = 0;
static int _DohMemoryHigh = 0;
static int _PoolSize = DOH_POOL_SIZE;
/* -----------------------------------------------------------------------------
* memory.c
@ -84,7 +85,7 @@ static void InitPools() {
for (i = 0; i < DOH_MAX_FRAG; i++) {
FreeFragments[i] = 0;
}
Pools = CreatePool(DOH_POOL_SIZE); /* Create initial pool */
Pools = CreatePool(_PoolSize); /* Create initial pool */
pools_initialized = 1;
}
@ -163,7 +164,7 @@ void *DohObjMalloc(size_t size) {
f->next = FreeFragments[f->len];
FreeFragments[f->len] = f;
}
p = CreatePool(DOH_POOL_SIZE);
p = CreatePool(_PoolSize);
p->next = Pools;
Pools = p;
return DohObjMalloc(size);
@ -260,3 +261,12 @@ int DohMemoryUse() {
int DohMemoryHigh() {
return _DohMemoryHigh;
}
int DohPoolSize(int poolsize) {
int ps;
ps = _PoolSize;
if (poolsize > 0) {
_PoolSize = poolsize;
}
return ps;
}

View file

@ -29,9 +29,6 @@
#define DOH_MAJOR_VERSION 0
#define DOH_MINOR_VERSION 1
extern int _DohMemoryCurrent;
extern int _DohMemoryHigh;
typedef void DOH;
#define DOH_BEGIN -1
@ -124,6 +121,7 @@ extern int DohCheck(DOH *ptr);
extern int DohFreeCheck(DOH *ptr);
extern int DohMemoryUse();
extern int DohMemoryHigh();
extern int DohPoolSize(int);
/* Low-level doh methods. Do not call directly (well, unless you want to). */
extern void DohError(int level, char *fmt,...);