--- libaitsess/src/Attic/mem.c 2012/02/28 12:01:12 1.1.2.8 +++ libaitsess/src/Attic/mem.c 2012/02/28 12:58:10 1.1.2.11 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: mem.c,v 1.1.2.8 2012/02/28 12:01:12 misho Exp $ +* $Id: mem.c,v 1.1.2.11 2012/02/28 12:58:10 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -149,8 +149,6 @@ pullInactive(mpool_t * __restrict mp, int idx) /* clear name */ *m->alloc_name = 0; - /* clear flags */ - m->alloc_flags ^= m->alloc_flags; } return m; @@ -277,7 +275,7 @@ mpool_realloc(mpool_t * __restrict mp, void * __restri /* quota */ if (mp->pool_quota.max && - (mp->pool_quota.curr + (newsize - osize)) > mp->pool_quota.max) { + (mp->pool_quota.curr + ((u_long) newsize - osize)) > mp->pool_quota.max) { sess_SetErr(ENOMEM, "Max.allocate memory quota has been reached"); mpool_unlock(mp); return NULL; @@ -318,10 +316,11 @@ mpool_realloc(mpool_t * __restrict mp, void * __restri mpool_unlock(mp); return NULL; - } + } else + m->alloc_mem = (u_int*) p; } /* quota */ - mp->pool_quota.curr += (newsize - osize); + mp->pool_quota.curr += (u_long) newsize - osize; m->alloc_mem[0] = newsize / sizeof(u_int); m->alloc_mem[1] = MEM_MAGIC_START;