1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-29 08:31:35 -08:00
emacs/mps/code/chain.h
Richard Brooksby 3d5e2ca85f Adding hopenames back into the master sources, so that they can be included in the union sources along with the id keywords.
This was achieved by partially undoing changelist 24817, including an accidental corruption of eventgen.pl.

Copied from Perforce
 Change: 24877
 ServerID: perforce.ravenbrook.com
2001-12-06 18:14:02 +00:00

92 lines
2.6 KiB
C

/* impl.h.chain: GENERATION CHAINS
*
* $Id$
* $HopeName: MMsrc!chain.h(trunk.2) $
* Copyright (c) 2001 Ravenbrook Limited.
*/
#ifndef chain_h
#define chain_h
#include "mpmtypes.h"
#include "ring.h"
/* GenParamStruct -- structure for specifying generation parameters */
/* .gen-param: This structure must match impl.h.mps.gen-param. */
typedef struct GenParamStruct {
Size capacity; /* capacity in kB */
double mortality;
} GenParamStruct;
/* GenDesc -- descriptor of a generation in a chain */
typedef struct GenDescStruct *GenDesc;
#define GenDescSig ((Sig)0x5199E4DE) /* SIGnature GEN DEsc */
typedef struct GenDescStruct {
Sig sig;
ZoneSet zones; /* zoneset for this generation */
Size capacity; /* capacity in kB */
double mortality;
double proflow; /* predicted proportion of survivors promoted */
RingStruct locusRing; /* this generation in all the pools using the chain */
} GenDescStruct;
/* PoolGen -- descriptor of a generation in a pool */
typedef struct PoolGenStruct *PoolGen;
#define PoolGenSig ((Sig)0x519B009E) /* SIGnature POOl GEn */
typedef struct PoolGenStruct {
Sig sig;
Serial nr; /* generation number */
Pool pool; /* pool this belongs to */
Chain chain; /* chain this belongs to */
RingStruct genRing; /* this generation in all the pools using this chain */
Size totalSize; /* total size of segs in gen in this pool */
Size newSize; /* size allocated since last GC */
} PoolGenStruct;
/* Chain -- a generation chain */
#define ChainSig ((Sig)0x519C8A14) /* SIGnature CHAIN */
typedef struct ChainStruct {
Sig sig;
Arena arena;
RingStruct chainRing; /* list of chains in the arena */
TraceSet activeTraces; /* set of traces collecting this chain */
size_t genCount; /* number of generations */
GenDescStruct *gens; /* the array of generations */
} ChainStruct;
extern Res ChainCreate(Chain *chainReturn, Arena arena, size_t genCount,
GenParamStruct *params);
extern void ChainDestroy(Chain chain);
extern Bool ChainCheck(Chain chain);
extern double ChainDeferral(Chain chain);
extern Res ChainCondemnAuto(double *mortalityReturn, Chain chain, Trace trace);
extern Res ChainCondemnAll(Chain chain, Trace trace);
extern void ChainStartGC(Chain chain, Trace trace);
extern void ChainEndGC(Chain chain, Trace trace);
extern size_t ChainGens(Chain chain);
extern Bool PoolGenCheck(PoolGen gen);
extern Res PoolGenInit(PoolGen gen, Chain chain, Serial nr, Pool pool);
extern void PoolGenFinish(PoolGen gen);
extern void PoolGenFlip(PoolGen gen);
#define PoolGenNr(gen) ((gen)->nr)
extern void PoolGenUpdateZones(PoolGen gen, Seg seg);
#endif /* chain_h */