mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-18 08:51:45 -08:00
Adding spacepoll mechanism
Copied from Perforce Change: 15246 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
7ccd633fa7
commit
ca85201e87
2 changed files with 21 additions and 20 deletions
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* ALLOCATION BUFFER IMPLEMENTATION
|
||||
*
|
||||
* $HopeName: MMsrc!buffer.c(trunk.4) $
|
||||
* $HopeName: MMsrc!buffer.c(trunk.5) $
|
||||
*
|
||||
* Copyright (C) 1995 Harlequin Group, all rights reserved
|
||||
*
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
#include "shield.h"
|
||||
#include "trace.h"
|
||||
|
||||
SRCID("$HopeName");
|
||||
SRCID("$HopeName$");
|
||||
|
||||
|
||||
static SigStruct BufferSigStruct;
|
||||
|
|
@ -272,6 +272,8 @@ Error BufferFill(Addr *pReturn, Buffer buffer, Addr size)
|
|||
|
||||
AVER(ISVALID(Buffer, buffer));
|
||||
|
||||
SpacePoll(BufferSpace(buffer));
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
/* ==== POOLS ====
|
||||
/* impl.c.pool: POOL IMPLEMENTATION
|
||||
*
|
||||
* $HopeName: MMsrc!pool.c(trunk.8) $
|
||||
* $HopeName: MMsrc!pool.c(trunk.9) $
|
||||
* Copyright (C) 1994,1995,1996 Harlequin Group, all rights reserved
|
||||
*
|
||||
* Copyright (C) 1994,1995 Harlequin Group, all rights reserved
|
||||
*
|
||||
* This is the implementation of the generic pool interface. The
|
||||
* functions here dispatch to pool-specific methods.
|
||||
*
|
||||
* Notes
|
||||
* 2. Some explanatory comments would be nice. richard 1994-08-25
|
||||
* This is the implementation of the generic pool interface. The
|
||||
* functions here dispatch to pool-specific methods.
|
||||
*/
|
||||
|
||||
#include "std.h"
|
||||
|
|
@ -23,15 +19,12 @@
|
|||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
SRCID("$HopeName$");
|
||||
SRCID("$HopeName: MMsrc!pool.c(trunk.9) $");
|
||||
|
||||
|
||||
static SigStruct PoolSigStruct;
|
||||
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
Bool PoolIsValid(Pool pool, ValidationType validParam)
|
||||
{
|
||||
AVER(pool != NULL);
|
||||
|
|
@ -44,8 +37,6 @@ Bool PoolIsValid(Pool pool, ValidationType validParam)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
#endif /* DEBUG */
|
||||
|
||||
|
||||
void PoolInit(Pool pool, Space space, PoolClass class)
|
||||
{
|
||||
|
|
@ -120,10 +111,11 @@ Error (PoolAlloc)(Addr *pReturn, Pool pool, Size size)
|
|||
/* Make sure that the allocated address was in the pool's memory. */
|
||||
AVER(PoolHasAddr(pool, (Addr)*pReturn));
|
||||
|
||||
SpacePoll(PoolSpace(pool));
|
||||
|
||||
return ErrSUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void PoolFree(Pool pool, Addr old, Size size)
|
||||
{
|
||||
AVER(ISVALID(Pool, pool));
|
||||
|
|
@ -141,14 +133,12 @@ Error PoolCondemn(Pool pool, Trace trace)
|
|||
return (*pool->class->condemn)(pool, trace);
|
||||
}
|
||||
|
||||
|
||||
void PoolMark(Pool pool, Trace trace)
|
||||
{
|
||||
if(pool->class->mark != NULL)
|
||||
(*pool->class->mark)(pool, trace);
|
||||
}
|
||||
|
||||
|
||||
Error PoolScan(Pool pool, Trace trace)
|
||||
{
|
||||
if(pool->class->scan != NULL)
|
||||
|
|
@ -169,6 +159,7 @@ void PoolReclaim(Pool pool, Trace trace)
|
|||
(*pool->class->reclaim)(pool, trace);
|
||||
}
|
||||
|
||||
|
||||
void PoolAccess(Pool pool, Addr seg, ProtMode mode)
|
||||
{
|
||||
if(pool->class->access != NULL)
|
||||
|
|
@ -176,6 +167,14 @@ void PoolAccess(Pool pool, Addr seg, ProtMode mode)
|
|||
}
|
||||
|
||||
|
||||
Size PoolPoll(Pool pool)
|
||||
{
|
||||
if(pool->class->poll != NULL)
|
||||
return (*pool->class->poll)(pool);
|
||||
return SPACE_POLL_MAX;
|
||||
}
|
||||
|
||||
|
||||
Error PoolDescribe(Pool pool, LibStream stream)
|
||||
{
|
||||
AVER(ISVALID(Pool, pool));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue