vmpool.c revision 1
1N/A/*********************************************************************** 1N/A* This software is part of the ast package * 1N/A* Copyright (c) 1985-2011 AT&T Intellectual Property * 1N/A* and is licensed under the * 1N/A* Common Public License, Version 1.0 * 1N/A* by AT&T Intellectual Property * 1N/A* A copy of the License is available at * 1N/A* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 1N/A* Information and Software Systems Research * 1N/A* Glenn Fowler <gsf@research.att.com> * 1N/A* David Korn <dgk@research.att.com> * 1N/A* Phong Vo <kpv@research.att.com> * 1N/A***********************************************************************/ 1N/A/* Method for pool allocation. 1N/A** All elements in a pool have the same size. 1N/A** The following fields of Vmdata_t are used as: 1N/A** pool: size of a block. 1N/A** free: list of free blocks. 1N/A** Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94. 1N/A /* look thru all segments for a suitable free block */ 1N/A for(;;)
/* must extend region */ 1N/Ahas_blk:
/* if get here, (tp, s, seg) must be well-defined */ 1N/A /* the block that has this address */ 1N/A /* see if this block has been freed */ 1N/A do { *d++ = 0;}
while(d <
ed);
1N/A/* Public interface */