/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2010 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
void _STUB_vmprivate(){}
#else
#include "vmhdr.h"
/* Private code used in the vmalloc library
**
** Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94.
*/
/* Get more memory for a region */
#if __STD_C
#else
#endif
{
#if DEBUG /* trace all allocation calls through the heap */
VMOPTIONS();
#endif
/* Get slightly more for administrative data */
if(s <= size) /* size was too large and we have wrapped around */
/* increase the rounding factor to reduce # of future extensions */
/* see if we can extend the current segment */
else
s = 0;
else
}
if(!addr)
else
size -= s;
}
}
while(!addr) /* try to get space */
break;
/* check with exception handler to see if we should continue */
if(!exceptf)
else
if(rv <= 0)
{ if(rv == 0)
}
}
}
if(seg)
{ /* extending current segment */
else
}
}
else
}
else
}
}
}
else
{ /* creating a new segment */
/* NOTE: for Vmbest, Vmdebug and Vmprofile the region's segment list
is reversely ordered by addresses. This is so that we can easily
check for the wild block.
*/
break;
if(lastsp)
}
/* make a fake header for possible segmented memory */
/* see if the wild block is still wild */
}
}
return bp;
}
/* Truncate a segment if possible */
#if __STD_C
#else
int exact;
#endif
{
if(exact)
else /* keep truncated amount to discipline requirements */
less = _Vmpagesize;
}
if(less <= 0 ||
return 0;
return less;
}
else
{ /* unlink segment from region */
}
else
;
}
/* now delete it */
return size;
/* space reduction failed, reinsert segment */
if(last)
}
else
}
return 0;
}
}
/* Externally visible names but local to library */
{ vmextend, /* _Vmextend */
vmtruncate, /* _Vmtruncate */
0, /* _Vmpagesize */
};
#endif