aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code
diff options
context:
space:
mode:
authorRichard Kistruck2006-11-23 14:38:19 +0000
committerRichard Kistruck2006-11-23 14:38:19 +0000
commitbe107db8f62ee5cd1d2641e92ad8279e0d8f7ad5 (patch)
tree621244106ab5a9a27b1c60213c3204f3636e931a /mps/code
parent8c612cef8d5080e3e1b0bc253f979bafd066fe78 (diff)
downloademacs-be107db8f62ee5cd1d2641e92ad8279e0d8f7ad5.tar.gz
emacs-be107db8f62ee5cd1d2641e92ad8279e0d8f7ad5.zip
Mps: gcgenmsg branch: back-out @51937: drj's incomplete poolgenmessage work
(DRJ's changes added PoolGenMessage struct, with text-fields for gen-name and forward-dest name, and condemned Size) The mps_message_gc_start() Message, with a _why field, remains. Copied from Perforce Change: 160989 ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
-rw-r--r--mps/code/chain.h22
-rw-r--r--mps/code/config.h8
-rw-r--r--mps/code/locus.c24
3 files changed, 5 insertions, 49 deletions
diff --git a/mps/code/chain.h b/mps/code/chain.h
index 325b9e876ce..d37a46ccde4 100644
--- a/mps/code/chain.h
+++ b/mps/code/chain.h
@@ -1,7 +1,7 @@
1/* chain.h: GENERATION CHAINS 1/* chain.h: GENERATION CHAINS
2 * 2 *
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001,2003 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 */ 5 */
6 6
7#ifndef chain_h 7#ifndef chain_h
@@ -11,22 +11,6 @@
11#include "ring.h" 11#include "ring.h"
12 12
13 13
14/* PoolGenMessageStruct implements mps_message_type_gc_gen(). Embedded
15 in PoolGenStruct. */
16
17typedef struct PoolGenMessageStruct *PoolGenMessage;
18
19#define PoolGenMessageSig ((Sig)0x519B9359) /* SIGnature PoolGenMeSsaGe */
20
21typedef struct PoolGenMessageStruct {
22 Sig sig;
23 char id[POOL_GEN_MESSAGE_ID_LEN];
24 Size condemned; /* byte count */
25 /* Textual description of forwarding generation. */
26 char forward[POOL_GEN_MESSAGE_FORWARD_LEN];
27 MessageStruct messageStruct;
28}
29
30/* GenParamStruct -- structure for specifying generation parameters */ 14/* GenParamStruct -- structure for specifying generation parameters */
31/* .gen-param: This structure must match <code/mps.h#gen-param>. */ 15/* .gen-param: This structure must match <code/mps.h#gen-param>. */
32 16
@@ -51,6 +35,7 @@ typedef struct GenDescStruct {
51 RingStruct locusRing; /* Ring of all PoolGen's in this GenDesc (locus) */ 35 RingStruct locusRing; /* Ring of all PoolGen's in this GenDesc (locus) */
52} GenDescStruct; 36} GenDescStruct;
53 37
38
54/* PoolGen -- descriptor of a generation in a pool */ 39/* PoolGen -- descriptor of a generation in a pool */
55 40
56typedef struct PoolGenStruct *PoolGen; 41typedef struct PoolGenStruct *PoolGen;
@@ -66,7 +51,6 @@ typedef struct PoolGenStruct {
66 RingStruct genRing; 51 RingStruct genRing;
67 Size totalSize; /* total size of segs in gen in this pool */ 52 Size totalSize; /* total size of segs in gen in this pool */
68 Size newSize; /* size allocated since last GC */ 53 Size newSize; /* size allocated since last GC */
69 PoolGenMessageStruct message;
70} PoolGenStruct; 54} PoolGenStruct;
71 55
72 56
@@ -110,7 +94,7 @@ extern void PoolGenUpdateZones(PoolGen gen, Seg seg);
110 94
111/* C. COPYRIGHT AND LICENSE 95/* C. COPYRIGHT AND LICENSE
112 * 96 *
113 * Copyright (C) 2001-2003 Ravenbrook Limited <http://www.ravenbrook.com/>. 97 * Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
114 * All rights reserved. This is an open source license. Contact 98 * All rights reserved. This is an open source license. Contact
115 * Ravenbrook for commercial licensing options. 99 * Ravenbrook for commercial licensing options.
116 * 100 *
diff --git a/mps/code/config.h b/mps/code/config.h
index 6afc19e48ad..c25b6c443c0 100644
--- a/mps/code/config.h
+++ b/mps/code/config.h
@@ -203,14 +203,6 @@
203#define VMANPageALIGNMENT ((Align)4096) 203#define VMANPageALIGNMENT ((Align)4096)
204#define VMJunkBYTE ((unsigned char)0xA9) 204#define VMJunkBYTE ((unsigned char)0xA9)
205 205
206/* Pool Gen Configuration -- see <code/chain.h> */
207
208/* Length (in chars) of a char buffer used to store the id and
209 forwarding generation in the implementation of
210 mps_message_type_gc_gen(). */
211#define POOL_GEN_MESSAGE_ID_LEN 64
212#define POOL_GEN_MESSAGE_FORWARD_LEN 64
213
214 206
215/* Tracer Configuration -- see <code/trace.c> */ 207/* Tracer Configuration -- see <code/trace.c> */
216 208
diff --git a/mps/code/locus.c b/mps/code/locus.c
index 42cfa48f099..81972cc860e 100644
--- a/mps/code/locus.c
+++ b/mps/code/locus.c
@@ -361,24 +361,6 @@ void ChainEndGC(Chain chain, Trace trace)
361 chain->activeTraces = TraceSetDel(chain->activeTraces, trace); 361 chain->activeTraces = TraceSetDel(chain->activeTraces, trace);
362} 362}
363 363
364#define PoolGenMessageMessage(m) (&(m)->messageStruct)
365#define MessagePoolGenMessage(message) \
366 (PARENT(PoolGenMessageStruct, messageStruct, message))
367
368static void PoolGenMessageInit(PoolGenMessage message, PoolGen gen)
369{
370 size_t i = 0;
371 size_t l;
372 /* message is to be initialised so can't be checked. */
373 /* gen is halfway through intialisation. Naughtily, we will
374 use some of it but not check it. */
375
376 message->id[i++] = '[';
377 ClassOfPool(gen->pool);
378 mps_lib_memcpy(message->id,
379 message->condemned = 0;
380}
381
382 364
383/* PoolGenInit -- initialize a PoolGen */ 365/* PoolGenInit -- initialize a PoolGen */
384 366
@@ -395,15 +377,13 @@ Res PoolGenInit(PoolGen gen, Chain chain, Serial nr, Pool pool)
395 RingInit(&gen->genRing); 377 RingInit(&gen->genRing);
396 gen->totalSize = (Size)0; 378 gen->totalSize = (Size)0;
397 gen->newSize = (Size)0; 379 gen->newSize = (Size)0;
398 PoolGenMessageInit(&gen->messageStruct);
399 gen->sig = PoolGenSig; 380 gen->sig = PoolGenSig;
400 381
401 if(nr != chain->genCount) { 382 if (nr != chain->genCount)
402 RingAppend(&chain->gens[nr].locusRing, &gen->genRing); 383 RingAppend(&chain->gens[nr].locusRing, &gen->genRing);
403 } else { 384 else
404 /* Dynamic generation is linked to the arena, not the chain. */ 385 /* Dynamic generation is linked to the arena, not the chain. */
405 RingAppend(&chain->arena->topGen.locusRing, &gen->genRing); 386 RingAppend(&chain->arena->topGen.locusRing, &gen->genRing);
406 }
407 AVERT(PoolGen, gen); 387 AVERT(PoolGen, gen);
408 return ResOK; 388 return ResOK;
409} 389}