aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code
diff options
context:
space:
mode:
authorRichard Brooksby2002-06-07 16:47:14 +0100
committerRichard Brooksby2002-06-07 16:47:14 +0100
commit97075f705350901f5ff46387f658ab459a4cd73f (patch)
tree4349ad5e7200f072a800f48749d57f3625757e7e /mps/code
parent8b990e4858b6f6d735de07a241b1785702bb16e7 (diff)
downloademacs-97075f705350901f5ff46387f658ab459a4cd73f.tar.gz
emacs-97075f705350901f5ff46387f658ab459a4cd73f.zip
Updating cross references to design documents to html style, to go with master/design document tree.
Copied from Perforce Change: 29897 ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
-rw-r--r--mps/code/abq.c2
-rw-r--r--mps/code/abq.h2
-rw-r--r--mps/code/arena.c18
-rw-r--r--mps/code/arenacl.c12
-rw-r--r--mps/code/arenavm.c18
-rw-r--r--mps/code/awlut.c2
-rw-r--r--mps/code/awluthe.c2
-rw-r--r--mps/code/awlutth.c2
-rw-r--r--mps/code/bt.c42
-rw-r--r--mps/code/buffer.c36
-rw-r--r--mps/code/cbs.c38
-rw-r--r--mps/code/cbs.h10
-rw-r--r--mps/code/check.h4
-rw-r--r--mps/code/config.h6
-rw-r--r--mps/code/dbgpool.c6
-rw-r--r--mps/code/event.h4
-rw-r--r--mps/code/eventcom.h2
-rw-r--r--mps/code/eventdef.h2
-rw-r--r--mps/code/finalcv.c14
-rw-r--r--mps/code/format.c2
-rw-r--r--mps/code/global.c32
-rw-r--r--mps/code/lock.h2
-rw-r--r--mps/code/lockan.c2
-rw-r--r--mps/code/lockfr.c2
-rw-r--r--mps/code/lockli.c2
-rw-r--r--mps/code/lockw3.c2
-rw-r--r--mps/code/locus.c4
-rw-r--r--mps/code/message.c4
-rw-r--r--mps/code/messtest.c4
-rw-r--r--mps/code/misc.h2
-rw-r--r--mps/code/mpm.c4
-rw-r--r--mps/code/mpm.h28
-rw-r--r--mps/code/mpmst.h84
-rw-r--r--mps/code/mpmtypes.h116
-rw-r--r--mps/code/mps.h2
-rw-r--r--mps/code/mpsi.c28
-rw-r--r--mps/code/mpsio.h2
-rw-r--r--mps/code/mpsioan.c2
-rw-r--r--mps/code/mpslib.h2
-rw-r--r--mps/code/mpsliban.c2
-rw-r--r--mps/code/mpsw3.h2
-rw-r--r--mps/code/pool.c10
-rw-r--r--mps/code/poolabs.c2
-rw-r--r--mps/code/poolamc.c66
-rw-r--r--mps/code/poolams.c56
-rw-r--r--mps/code/poolams.h6
-rw-r--r--mps/code/poolawl.c16
-rw-r--r--mps/code/poollo.c2
-rw-r--r--mps/code/poolmrg.c38
-rw-r--r--mps/code/poolmv.c2
-rw-r--r--mps/code/poolmv2.c40
-rw-r--r--mps/code/poolmv2.h2
-rw-r--r--mps/code/poolmvff.c16
-rw-r--r--mps/code/pooln.h2
-rw-r--r--mps/code/poolsnc.c6
-rw-r--r--mps/code/prmcan.c2
-rw-r--r--mps/code/protan.c6
-rw-r--r--mps/code/proti3.c2
-rw-r--r--mps/code/protocol.c2
-rw-r--r--mps/code/protocol.h10
-rw-r--r--mps/code/protsu.c8
-rw-r--r--mps/code/pthrdext.c20
-rw-r--r--mps/code/pthrdext.h2
-rw-r--r--mps/code/reserv.c12
-rw-r--r--mps/code/ring.c4
-rw-r--r--mps/code/ring.h4
-rw-r--r--mps/code/root.c8
-rw-r--r--mps/code/seg.c44
-rw-r--r--mps/code/segsmss.c6
-rw-r--r--mps/code/shield.c10
-rw-r--r--mps/code/splay.c36
-rw-r--r--mps/code/splay.h2
-rw-r--r--mps/code/sso1al.s2
-rw-r--r--mps/code/than.c4
-rw-r--r--mps/code/thfri4.c4
-rw-r--r--mps/code/thlii4.c4
-rw-r--r--mps/code/thw3i3.c4
-rw-r--r--mps/code/trace.c26
-rw-r--r--mps/code/tract.c6
-rw-r--r--mps/code/tract.h20
-rw-r--r--mps/code/version.c2
-rw-r--r--mps/code/vman.c4
-rw-r--r--mps/code/vmfr.c6
-rw-r--r--mps/code/vmi5.c4
-rw-r--r--mps/code/vmli.c6
-rw-r--r--mps/code/vmo1.c8
-rw-r--r--mps/code/vmso.c4
-rw-r--r--mps/code/vmsu.c4
-rw-r--r--mps/code/vmw3.c4
-rw-r--r--mps/code/vmxc.c4
-rw-r--r--mps/code/walk.c4
91 files changed, 557 insertions, 557 deletions
diff --git a/mps/code/abq.c b/mps/code/abq.c
index 74ab8066ea8..94ac5dd4680 100644
--- a/mps/code/abq.c
+++ b/mps/code/abq.c
@@ -7,7 +7,7 @@
7 * 7 *
8 * .purpose: A FIFO queue substrate for impl.c.poolmv2 8 * .purpose: A FIFO queue substrate for impl.c.poolmv2
9 * 9 *
10 * .design: See design.mps.poolmv2 10 * .design: See <design/poolmv2/>
11 */ 11 */
12 12
13#include "meter.h" 13#include "meter.h"
diff --git a/mps/code/abq.h b/mps/code/abq.h
index d2ceccf67f7..608240b4474 100644
--- a/mps/code/abq.h
+++ b/mps/code/abq.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * .purpose: A FIFO queue substrate for impl.c.poolmv2 6 * .purpose: A FIFO queue substrate for impl.c.poolmv2
7 * 7 *
8 * .source: design.mps.poolmv2 8 * .source: <design/poolmv2/>
9 */ 9 */
10 10
11#ifndef abq_h 11#ifndef abq_h
diff --git a/mps/code/arena.c b/mps/code/arena.c
index 665ffc59b25..2d6ace20240 100644
--- a/mps/code/arena.c
+++ b/mps/code/arena.c
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .sources: design.mps.arena is the main design document. */ 6 * .sources: <design/arena/> is the main design document. */
7 7
8#include "tract.h" 8#include "tract.h"
9#include "poolmv.h" 9#include "poolmv.h"
@@ -32,7 +32,7 @@ static Res ArenaTrivDescribe(Arena arena, mps_lib_FILE *stream)
32/* AbstractArenaClass -- The abstact arena class definition 32/* AbstractArenaClass -- The abstact arena class definition
33 * 33 *
34 * .null: Most abstract class methods are set to NULL. See 34 * .null: Most abstract class methods are set to NULL. See
35 * design.mps.arena.class.abstract.null. */ 35 * <design/arena/#class.abstract.null>. */
36 36
37typedef ArenaClassStruct AbstractArenaClassStruct; 37typedef ArenaClassStruct AbstractArenaClassStruct;
38 38
@@ -91,7 +91,7 @@ Bool ArenaCheck(Arena arena)
91 CHECKD(ArenaClass, arena->class); 91 CHECKD(ArenaClass, arena->class);
92 92
93 CHECKL(BoolCheck(arena->poolReady)); 93 CHECKL(BoolCheck(arena->poolReady));
94 if (arena->poolReady) { /* design.mps.arena.pool.ready */ 94 if (arena->poolReady) { /* <design/arena/#pool.ready> */
95 CHECKD(MV, &arena->controlPoolStruct); 95 CHECKD(MV, &arena->controlPoolStruct);
96 CHECKD(Reservoir, &arena->reservoirStruct); 96 CHECKD(Reservoir, &arena->reservoirStruct);
97 } 97 }
@@ -154,7 +154,7 @@ Res ArenaInit(Arena arena, ArenaClass class)
154 arena->alignment = 1 << ARENA_ZONESHIFT; 154 arena->alignment = 1 << ARENA_ZONESHIFT;
155 /* zoneShift is usually overridden by init */ 155 /* zoneShift is usually overridden by init */
156 arena->zoneShift = ARENA_ZONESHIFT; 156 arena->zoneShift = ARENA_ZONESHIFT;
157 arena->poolReady = FALSE; /* design.mps.arena.pool.ready */ 157 arena->poolReady = FALSE; /* <design/arena/#pool.ready> */
158 arena->lastTract = NULL; 158 arena->lastTract = NULL;
159 arena->lastTractBase = NULL; 159 arena->lastTractBase = NULL;
160 160
@@ -171,7 +171,7 @@ Res ArenaInit(Arena arena, ArenaClass class)
171 171
172 arena->sig = ArenaSig; 172 arena->sig = ArenaSig;
173 173
174 /* initialize the reservoir, design.mps.reservoir */ 174 /* initialize the reservoir, <design/reservoir/> */
175 res = ReservoirInit(&arena->reservoirStruct, arena); 175 res = ReservoirInit(&arena->reservoirStruct, arena);
176 if (res != ResOK) 176 if (res != ResOK)
177 goto failReservoirInit; 177 goto failReservoirInit;
@@ -282,7 +282,7 @@ Res ControlInit(Arena arena)
282 ARENA_CONTROL_MAXSIZE); 282 ARENA_CONTROL_MAXSIZE);
283 if (res != ResOK) 283 if (res != ResOK)
284 return res; 284 return res;
285 arena->poolReady = TRUE; /* design.mps.arena.pool.ready */ 285 arena->poolReady = TRUE; /* <design/arena/#pool.ready> */
286 return ResOK; 286 return ResOK;
287} 287}
288 288
@@ -393,7 +393,7 @@ Res ArenaDescribeTracts(Arena arena, mps_lib_FILE *stream)
393 * control pool, which is an MV pool embedded in the arena itself. 393 * control pool, which is an MV pool embedded in the arena itself.
394 * 394 *
395 * .controlalloc.addr: In implementations where Addr is not compatible 395 * .controlalloc.addr: In implementations where Addr is not compatible
396 * with void* (design.mps.type.addr.use), ControlAlloc must take care of 396 * with void* (<design/type/#addr.use>), ControlAlloc must take care of
397 * allocating so that the block can be addressed with a void*. */ 397 * allocating so that the block can be addressed with a void*. */
398 398
399Res ControlAlloc(void **baseReturn, Arena arena, size_t size, 399Res ControlAlloc(void **baseReturn, Arena arena, size_t size,
@@ -474,7 +474,7 @@ Res ArenaAlloc(Addr *baseReturn, SegPref pref, Size size, Pool pool,
474 return res; 474 return res;
475 475
476goodAlloc: 476goodAlloc:
477 /* cache the tract - design.mps.arena.tract.cache */ 477 /* cache the tract - <design/arena/#tract.cache> */
478 arena->lastTract = baseTract; 478 arena->lastTract = baseTract;
479 arena->lastTractBase = base; 479 arena->lastTractBase = base;
480 480
@@ -503,7 +503,7 @@ void ArenaFree(Addr base, Size size, Pool pool)
503 AVER(AddrIsAligned(base, arena->alignment)); 503 AVER(AddrIsAligned(base, arena->alignment));
504 AVER(SizeIsAligned(size, arena->alignment)); 504 AVER(SizeIsAligned(size, arena->alignment));
505 505
506 /* uncache the tract if in range - design.mps.arena.tract.uncache */ 506 /* uncache the tract if in range - <design/arena/#tract.uncache> */
507 limit = AddrAdd(base, size); 507 limit = AddrAdd(base, size);
508 if ((arena->lastTractBase >= base) && (arena->lastTractBase < limit)) { 508 if ((arena->lastTractBase >= base) && (arena->lastTractBase < limit)) {
509 arena->lastTract = NULL; 509 arena->lastTract = NULL;
diff --git a/mps/code/arenacl.c b/mps/code/arenacl.c
index 89605fdd147..18ede55dafa 100644
--- a/mps/code/arenacl.c
+++ b/mps/code/arenacl.c
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .design: See design.mps.arena.client. 6 * .design: See <design/arena/#client>.
7 * 7 *
8 * .improve.remember: One possible performance improvement is to 8 * .improve.remember: One possible performance improvement is to
9 * remember (a conservative approximation to) the indices of the first 9 * remember (a conservative approximation to) the indices of the first
@@ -25,7 +25,7 @@ SRCID(arenacl, "$Id$");
25 25
26typedef struct ClientArenaStruct { 26typedef struct ClientArenaStruct {
27 ArenaStruct arenaStruct; /* generic arena structure */ 27 ArenaStruct arenaStruct; /* generic arena structure */
28 Sig sig; /* design.mps.sig */ 28 Sig sig; /* <design/sig/> */
29} ClientArenaStruct; 29} ClientArenaStruct;
30typedef struct ClientArenaStruct *ClientArena; 30typedef struct ClientArenaStruct *ClientArena;
31 31
@@ -43,7 +43,7 @@ typedef struct ClientChunkStruct {
43 ChunkStruct chunkStruct; /* generic chunk */ 43 ChunkStruct chunkStruct; /* generic chunk */
44 Size freePages; /* number of free pages in chunk */ 44 Size freePages; /* number of free pages in chunk */
45 Addr pageBase; /* base of first managed page in chunk */ 45 Addr pageBase; /* base of first managed page in chunk */
46 Sig sig; /* design.mps.sig */ 46 Sig sig; /* <design/sig/> */
47} ClientChunkStruct; 47} ClientChunkStruct;
48 48
49#define ClientChunk2Chunk(clchunk) (&(clchunk)->chunkStruct) 49#define ClientChunk2Chunk(clchunk) (&(clchunk)->chunkStruct)
@@ -110,7 +110,7 @@ static Res clientChunkCreate(Chunk *chunkReturn, Addr base, Addr limit,
110 goto failBootInit; 110 goto failBootInit;
111 111
112 /* Allocate the chunk. */ 112 /* Allocate the chunk. */
113 /* See design.mps.arena.@@@@ */ 113 /* See <design/arena/>.@@@@ */
114 res = BootAlloc(&p, boot, sizeof(ClientChunkStruct), MPS_PF_ALIGN); 114 res = BootAlloc(&p, boot, sizeof(ClientChunkStruct), MPS_PF_ALIGN);
115 if (res != ResOK) 115 if (res != ResOK)
116 goto failChunkAlloc; 116 goto failChunkAlloc;
@@ -340,7 +340,7 @@ static Res chunkAlloc(Addr *baseReturn, Tract *baseTractReturn,
340 340
341 /* Check commit limit. Note that if there are multiple reasons */ 341 /* Check commit limit. Note that if there are multiple reasons */
342 /* for failing the allocation we attempt to return other result codes */ 342 /* for failing the allocation we attempt to return other result codes */
343 /* in preference to ResCOMMIT_LIMIT. See design.mps.arena.commit-limit */ 343 /* in preference to ResCOMMIT_LIMIT. See <design/arena/#commit-limit> */
344 if (ArenaCommitted(arena) + pages * ChunkPageSize(chunk) 344 if (ArenaCommitted(arena) + pages * ChunkPageSize(chunk)
345 > arena->commitLimit) { 345 > arena->commitLimit) {
346 return ResCOMMIT_LIMIT; 346 return ResCOMMIT_LIMIT;
@@ -382,7 +382,7 @@ static Res ClientAlloc(Addr *baseReturn, Tract *baseTractReturn,
382 /* All chunks have same pageSize. */ 382 /* All chunks have same pageSize. */
383 AVER(SizeIsAligned(size, ChunkPageSize(arena->primary))); 383 AVER(SizeIsAligned(size, ChunkPageSize(arena->primary)));
384 /* NULL is used as a discriminator (see */ 384 /* NULL is used as a discriminator (see */
385 /* design.mps.arenavm.table.disc), therefore the real pool */ 385 /* <design/arenavm/#table.disc>), therefore the real pool */
386 /* must be non-NULL. */ 386 /* must be non-NULL. */
387 AVER(pool != NULL); 387 AVER(pool != NULL);
388 388
diff --git a/mps/code/arenavm.c b/mps/code/arenavm.c
index 6e1742bfadd..8c135c9742a 100644
--- a/mps/code/arenavm.c
+++ b/mps/code/arenavm.c
@@ -6,7 +6,7 @@
6 * 6 *
7 * DESIGN 7 * DESIGN
8 * 8 *
9 * .design: See design.mps.arena.vm, and design.mps.arena.coop-vm 9 * .design: See <design/arenavm/>, and <design/arena/#coop-vm>
10 * 10 *
11 * .vm.addr-is-star: In this file, Addr is compatible with C 11 * .vm.addr-is-star: In this file, Addr is compatible with C
12 * pointers, and Count with size_t (Index), because all refer to the 12 * pointers, and Count with size_t (Index), because all refer to the
@@ -47,7 +47,7 @@ typedef struct VMChunkStruct {
47 Addr overheadMappedLimit; /* limit of pages mapped for overhead */ 47 Addr overheadMappedLimit; /* limit of pages mapped for overhead */
48 BT pageTableMapped; /* indicates mapped state of page table */ 48 BT pageTableMapped; /* indicates mapped state of page table */
49 BT noSparePages; /* 1 bit per page of pageTable */ 49 BT noSparePages; /* 1 bit per page of pageTable */
50 Sig sig; /* design.mps.sig */ 50 Sig sig; /* <design/sig/> */
51} VMChunkStruct; 51} VMChunkStruct;
52 52
53#define VMChunk2Chunk(vmchunk) (&(vmchunk)->chunkStruct) 53#define VMChunk2Chunk(vmchunk) (&(vmchunk)->chunkStruct)
@@ -62,7 +62,7 @@ typedef struct VMChunkStruct {
62 62
63/* VMArena 63/* VMArena
64 * 64 *
65 * See design.mps.arena.coop-vm.struct.vmarena for description. 65 * See <design/arena/#coop-vm.struct.vmarena> for description.
66 */ 66 */
67 67
68typedef struct VMArenaStruct *VMArena; 68typedef struct VMArenaStruct *VMArena;
@@ -77,7 +77,7 @@ typedef struct VMArenaStruct { /* VM arena structure */
77 ZoneSet genZoneSet[VMArenaGenCount]; /* .gencount.const */ 77 ZoneSet genZoneSet[VMArenaGenCount]; /* .gencount.const */
78 ZoneSet freeSet; /* unassigned zones */ 78 ZoneSet freeSet; /* unassigned zones */
79 Size extendBy; 79 Size extendBy;
80 Sig sig; /* design.mps.sig */ 80 Sig sig; /* <design/sig/> */
81} VMArenaStruct; 81} VMArenaStruct;
82 82
83#define Arena2VMArena(arena) PARENT(VMArenaStruct, arenaStruct, arena) 83#define Arena2VMArena(arena) PARENT(VMArenaStruct, arenaStruct, arena)
@@ -273,7 +273,7 @@ static Res VMChunkCreate(Chunk *chunkReturn, VMArena vmArena, Size size)
273 goto failBootInit; 273 goto failBootInit;
274 274
275 /* Allocate and map the descriptor. */ 275 /* Allocate and map the descriptor. */
276 /* See design.mps.arena.@@@@ */ 276 /* See <design/arena/>.@@@@ */
277 res = BootAlloc(&p, boot, sizeof(VMChunkStruct), MPS_PF_ALIGN); 277 res = BootAlloc(&p, boot, sizeof(VMChunkStruct), MPS_PF_ALIGN);
278 if (res != ResOK) 278 if (res != ResOK)
279 goto failChunkAlloc; 279 goto failChunkAlloc;
@@ -333,7 +333,7 @@ static Res VMChunkInit(Chunk chunk, BootBlock boot)
333 goto failnoSparePages; 333 goto failnoSparePages;
334 vmChunk->noSparePages = p; 334 vmChunk->noSparePages = p;
335 335
336 /* Actually commit all the tables. design.mps.arena.vm.@@@@ */ 336 /* Actually commit all the tables. <design/arenavm/>.@@@@ */
337 overheadLimit = AddrAdd(chunk->base, (Size)BootAllocated(boot)); 337 overheadLimit = AddrAdd(chunk->base, (Size)BootAllocated(boot));
338 if (vmChunk->overheadMappedLimit < overheadLimit) { 338 if (vmChunk->overheadMappedLimit < overheadLimit) {
339 overheadLimit = AddrAlignUp(overheadLimit, ChunkPageSize(chunk)); 339 overheadLimit = AddrAlignUp(overheadLimit, ChunkPageSize(chunk));
@@ -438,7 +438,7 @@ static Res VMArenaInit(Arena *arenaReturn, ArenaClass class, va_list args)
438 vmArena->genZoneSet[gen] = ZoneSetEMPTY; 438 vmArena->genZoneSet[gen] = ZoneSetEMPTY;
439 } 439 }
440 vmArena->freeSet = ZoneSetUNIV; /* includes blacklist */ 440 vmArena->freeSet = ZoneSetUNIV; /* includes blacklist */
441 /* design.mps.arena.coop-vm.struct.vmarena.extendby.init */ 441 /* <design/arena/#coop-vm.struct.vmarena.extendby.init> */
442 vmArena->extendBy = userSize; 442 vmArena->extendBy = userSize;
443 443
444 /* have to have a valid arena before calling ChunkCreate */ 444 /* have to have a valid arena before calling ChunkCreate */
@@ -452,7 +452,7 @@ static Res VMArenaInit(Arena *arenaReturn, ArenaClass class, va_list args)
452 /* number of stripes as will fit into a reference set (the number of */ 452 /* number of stripes as will fit into a reference set (the number of */
453 /* bits in a word). Fail if the chunk is so small stripes are smaller */ 453 /* bits in a word). Fail if the chunk is so small stripes are smaller */
454 /* than pages. Note that some zones are discontiguous in the chunk if */ 454 /* than pages. Note that some zones are discontiguous in the chunk if */
455 /* the size is not a power of 2. See design.mps.arena.class.fields. */ 455 /* the size is not a power of 2. See <design/arena/#class.fields>. */
456 chunkSize = AddrOffset(chunk->base, chunk->limit); 456 chunkSize = AddrOffset(chunk->base, chunk->limit);
457 arena->zoneShift = SizeFloorLog2(chunkSize >> MPS_WORD_SHIFT); 457 arena->zoneShift = SizeFloorLog2(chunkSize >> MPS_WORD_SHIFT);
458 458
@@ -1221,7 +1221,7 @@ static Res vmAllocComm(Addr *baseReturn, Tract *baseTractReturn,
1221 AVER(SizeIsAligned(size, ChunkPageSize(arena->primary))); 1221 AVER(SizeIsAligned(size, ChunkPageSize(arena->primary)));
1222 1222
1223 /* NULL is used as a discriminator */ 1223 /* NULL is used as a discriminator */
1224 /* (see design.mps.arena.vm.table.disc) therefore the real pool */ 1224 /* (see <design/arenavm/table.disc>) therefore the real pool */
1225 /* must be non-NULL. */ 1225 /* must be non-NULL. */
1226 AVER(pool != NULL); 1226 AVER(pool != NULL);
1227 1227
diff --git a/mps/code/awlut.c b/mps/code/awlut.c
index 4f9410bd6f7..0f17b1efbd3 100644
--- a/mps/code/awlut.c
+++ b/mps/code/awlut.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * DESIGN 6 * DESIGN
7 * 7 *
8 * .design: see design.mps.poolawl.test.* 8 * .design: see <design/poolawl/#test>.*
9 */ 9 */
10 10
11#include "mpscawl.h" 11#include "mpscawl.h"
diff --git a/mps/code/awluthe.c b/mps/code/awluthe.c
index aac1d45dabd..251ad76aaf6 100644
--- a/mps/code/awluthe.c
+++ b/mps/code/awluthe.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * DESIGN 6 * DESIGN
7 * 7 *
8 * .design: see design.mps.poolawl.test.* 8 * .design: see <design/poolawl/#test>.*
9 */ 9 */
10 10
11#include "mpscawl.h" 11#include "mpscawl.h"
diff --git a/mps/code/awlutth.c b/mps/code/awlutth.c
index c4ce32428d9..a9d34e00dff 100644
--- a/mps/code/awlutth.c
+++ b/mps/code/awlutth.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * DESIGN 6 * DESIGN
7 * 7 *
8 * .design: see design.mps.poolawl.test.* 8 * .design: see <design/poolawl/#test>.*
9 */ 9 */
10 10
11#include "mpscawl.h" 11#include "mpscawl.h"
diff --git a/mps/code/bt.c b/mps/code/bt.c
index 496479a94b6..687aa4675b7 100644
--- a/mps/code/bt.c
+++ b/mps/code/bt.c
@@ -9,7 +9,7 @@
9 * 9 *
10 * DESIGN 10 * DESIGN
11 * 11 *
12 * .design: see design.mps.bt 12 * .design: see <design/bt/>
13 */ 13 */
14 14
15#include "mpm.h" 15#include "mpm.h"
@@ -168,7 +168,7 @@ SRCID(bt, "$Id$");
168 168
169/* BTCreate -- allocate a BT from the control pool 169/* BTCreate -- allocate a BT from the control pool
170 * 170 *
171 * See design.mps.bt.if.create 171 * See <design/bt/#if.create>
172 */ 172 */
173 173
174Res BTCreate(BT *btReturn, Arena arena, Count length) 174Res BTCreate(BT *btReturn, Arena arena, Count length)
@@ -194,7 +194,7 @@ Res BTCreate(BT *btReturn, Arena arena, Count length)
194 194
195/* BTDestroy -- free a BT to the control pool. 195/* BTDestroy -- free a BT to the control pool.
196 * 196 *
197 * See design.mps.bt.if.destroy 197 * See <design/bt/#if.destroy>
198 */ 198 */
199 199
200void BTDestroy(BT bt, Arena arena, Count length) 200void BTDestroy(BT bt, Arena arena, Count length)
@@ -223,7 +223,7 @@ static Bool BTCheck(BT bt)
223 223
224/* BTSize -- return the size of a BT 224/* BTSize -- return the size of a BT
225 * 225 *
226 * See design.mps.bt.fun.size 226 * See <design/bt/#fun.size>
227 */ 227 */
228 228
229size_t (BTSize)(unsigned long n) 229size_t (BTSize)(unsigned long n)
@@ -237,7 +237,7 @@ size_t (BTSize)(unsigned long n)
237 237
238/* BTGet -- get a bit from a BT 238/* BTGet -- get a bit from a BT
239 * 239 *
240 * See design.mps.bt.fun.get 240 * See <design/bt/#fun.get>
241 */ 241 */
242 242
243Bool (BTGet)(BT t, Index i) 243Bool (BTGet)(BT t, Index i)
@@ -252,7 +252,7 @@ Bool (BTGet)(BT t, Index i)
252 252
253/* BTSet -- set a bit in a BT 253/* BTSet -- set a bit in a BT
254 * 254 *
255 * See design.mps.bt.fun.set 255 * See <design/bt/#fun.set>
256 */ 256 */
257 257
258void (BTSet)(BT t, Index i) 258void (BTSet)(BT t, Index i)
@@ -267,7 +267,7 @@ void (BTSet)(BT t, Index i)
267 267
268/* BTRes -- reset a bit in a BT 268/* BTRes -- reset a bit in a BT
269 * 269 *
270 * design.mps.bt.fun.res 270 * <design/bt/#fun.res>
271 */ 271 */
272 272
273void (BTRes)(BT t, Index i) 273void (BTRes)(BT t, Index i)
@@ -282,7 +282,7 @@ void (BTRes)(BT t, Index i)
282 282
283/* BTSetRange -- set a range of bits in a BT 283/* BTSetRange -- set a range of bits in a BT
284 * 284 *
285 * design.mps.bt.fun.set-range 285 * <design/bt/#fun.set-range>
286 */ 286 */
287 287
288void BTSetRange(BT t, Index base, Index limit) 288void BTSetRange(BT t, Index base, Index limit)
@@ -304,7 +304,7 @@ void BTSetRange(BT t, Index base, Index limit)
304 304
305/* BTIsResRange -- test whether a range of bits is all reset 305/* BTIsResRange -- test whether a range of bits is all reset
306 * 306 *
307 * See design.mps.bt.fun.is-reset-range. 307 * See <design/bt/#fun.is-reset-range>.
308 */ 308 */
309 309
310Bool BTIsResRange(BT bt, Index base, Index limit) 310Bool BTIsResRange(BT bt, Index base, Index limit)
@@ -328,7 +328,7 @@ Bool BTIsResRange(BT bt, Index base, Index limit)
328 328
329/* BTIsSetRange -- test whether a range of bits is all set 329/* BTIsSetRange -- test whether a range of bits is all set
330 * 330 *
331 * See design.mps.bt.fun.is-set-range. 331 * See <design/bt/#fun.is-set-range>.
332 */ 332 */
333 333
334Bool BTIsSetRange(BT bt, Index base, Index limit) 334Bool BTIsSetRange(BT bt, Index base, Index limit)
@@ -356,7 +356,7 @@ Bool BTIsSetRange(BT bt, Index base, Index limit)
356 356
357/* BTResRange -- reset a range of bits in a BT 357/* BTResRange -- reset a range of bits in a BT
358 * 358 *
359 * design.mps.bt.fun.res-range 359 * <design/bt/#fun.res-range>
360 */ 360 */
361 361
362void BTResRange(BT t, Index base, Index limit) 362void BTResRange(BT t, Index base, Index limit)
@@ -609,7 +609,7 @@ btFindResHighLabel:; \
609 * 609 *
610 * Starts searching at the low end of the search range. 610 * Starts searching at the low end of the search range.
611 * 611 *
612 * See design.mps.bt.fun.find-res-range. 612 * See <design/bt/#fun.find-res-range>.
613 */ 613 */
614 614
615static Bool BTFindResRange(Index *baseReturn, Index *limitReturn, 615static Bool BTFindResRange(Index *baseReturn, Index *limitReturn,
@@ -696,7 +696,7 @@ static Bool BTFindResRange(Index *baseReturn, Index *limitReturn,
696 * 696 *
697 * Starts searching at the high end of the search range. 697 * Starts searching at the high end of the search range.
698 * 698 *
699 * See design.mps.bt.fun.find-res-range. 699 * See <design/bt/#fun.find-res-range>.
700 */ 700 */
701 701
702static Bool BTFindResRangeHigh(Index *baseReturn, Index *limitReturn, 702static Bool BTFindResRangeHigh(Index *baseReturn, Index *limitReturn,
@@ -789,7 +789,7 @@ static Bool BTFindResRangeHigh(Index *baseReturn, Index *limitReturn,
789 789
790/* BTFindLongResRange -- find long range of reset bits in a bit table 790/* BTFindLongResRange -- find long range of reset bits in a bit table
791 * 791 *
792 * See design.mps.bt.fun.find-long-res-range. 792 * See <design/bt/#fun.find-long-res-range>.
793 */ 793 */
794 794
795Bool BTFindLongResRange(Index *baseReturn, Index *limitReturn, 795Bool BTFindLongResRange(Index *baseReturn, Index *limitReturn,
@@ -807,7 +807,7 @@ Bool BTFindLongResRange(Index *baseReturn, Index *limitReturn,
807 807
808/* BTFindLongResRangeHigh -- find long range of reset bits in a bit table 808/* BTFindLongResRangeHigh -- find long range of reset bits in a bit table
809 * 809 *
810 * See design.mps.bt.fun.find-long-res-range-high. 810 * See <design/bt/#fun.find-long-res-range-high>.
811 */ 811 */
812 812
813Bool BTFindLongResRangeHigh(Index *baseReturn, Index *limitReturn, 813Bool BTFindLongResRangeHigh(Index *baseReturn, Index *limitReturn,
@@ -825,7 +825,7 @@ Bool BTFindLongResRangeHigh(Index *baseReturn, Index *limitReturn,
825 825
826/* BTFindShortResRange -- find short range of reset bits in a bit table 826/* BTFindShortResRange -- find short range of reset bits in a bit table
827 * 827 *
828 * See design.mps.bt.fun.find-short-res-range. 828 * See <design/bt/#fun.find-short-res-range>.
829 */ 829 */
830 830
831Bool BTFindShortResRange(Index *baseReturn, Index *limitReturn, 831Bool BTFindShortResRange(Index *baseReturn, Index *limitReturn,
@@ -844,7 +844,7 @@ Bool BTFindShortResRange(Index *baseReturn, Index *limitReturn,
844 * 844 *
845 * Starts looking from the top of the search range. 845 * Starts looking from the top of the search range.
846 * 846 *
847 * See design.mps.bt.fun.find-short-res-range-high. 847 * See <design/bt/#fun.find-short-res-range-high>.
848 */ 848 */
849 849
850Bool BTFindShortResRangeHigh(Index *baseReturn, Index *limitReturn, 850Bool BTFindShortResRangeHigh(Index *baseReturn, Index *limitReturn,
@@ -862,7 +862,7 @@ Bool BTFindShortResRangeHigh(Index *baseReturn, Index *limitReturn,
862 862
863/* BTRangesSame -- check that a range of bits in two BTs are the same. 863/* BTRangesSame -- check that a range of bits in two BTs are the same.
864 * 864 *
865 * See design.mps.bt.if.ranges-same 865 * See <design/bt/#if.ranges-same>
866 */ 866 */
867 867
868Bool BTRangesSame(BT comparand, BT comparator, Index base, Index limit) 868Bool BTRangesSame(BT comparand, BT comparator, Index base, Index limit)
@@ -898,7 +898,7 @@ Bool BTRangesSame(BT comparand, BT comparator, Index base, Index limit)
898/* BTCopyInvertRange -- copy a range of bits from one BT to another, 898/* BTCopyInvertRange -- copy a range of bits from one BT to another,
899 * inverting them as you go. 899 * inverting them as you go.
900 * 900 *
901 * See design.mps.bt.if.copy-invert-range 901 * See <design/bt/#if.copy-invert-range>
902 */ 902 */
903 903
904void BTCopyInvertRange(BT fromBT, BT toBT, Index base, Index limit) 904void BTCopyInvertRange(BT fromBT, BT toBT, Index base, Index limit)
@@ -933,7 +933,7 @@ void BTCopyInvertRange(BT fromBT, BT toBT, Index base, Index limit)
933 933
934/* BTCopyRange -- copy a range of bits from one BT to another 934/* BTCopyRange -- copy a range of bits from one BT to another
935 * 935 *
936 * See design.mps.bt.if.copy-range 936 * See <design/bt/#if.copy-range>
937 */ 937 */
938 938
939void BTCopyRange(BT fromBT, BT toBT, Index base, Index limit) 939void BTCopyRange(BT fromBT, BT toBT, Index base, Index limit)
@@ -973,7 +973,7 @@ void BTCopyRange(BT fromBT, BT toBT, Index base, Index limit)
973 * may differ for each range. We could try to be smart about 973 * may differ for each range. We could try to be smart about
974 * detecting similar alignment - but we don't. 974 * detecting similar alignment - but we don't.
975 * 975 *
976 * See design.mps.bt.if.copy-offset-range 976 * See <design/bt/#if.copy-offset-range>
977 */ 977 */
978 978
979void BTCopyOffsetRange(BT fromBT, BT toBT, 979void BTCopyOffsetRange(BT fromBT, BT toBT,
diff --git a/mps/code/buffer.c b/mps/code/buffer.c
index 635319d7a98..831efac5c06 100644
--- a/mps/code/buffer.c
+++ b/mps/code/buffer.c
@@ -10,7 +10,7 @@
10 * 10 *
11 * DESIGN 11 * DESIGN
12 * 12 *
13 * .design: See design.mps.buffer. 13 * .design: See <design/buffer/>.
14 * 14 *
15 * .ap.async: The mutator is allowed to change certain AP fields 15 * .ap.async: The mutator is allowed to change certain AP fields
16 * asynchronously. Functions that can be called on buffers not 16 * asynchronously. Functions that can be called on buffers not
@@ -44,7 +44,7 @@ Bool BufferCheck(Buffer buffer)
44 CHECKU(Arena, buffer->arena); 44 CHECKU(Arena, buffer->arena);
45 CHECKU(Pool, buffer->pool); 45 CHECKU(Pool, buffer->pool);
46 CHECKL(buffer->arena == buffer->pool->arena); 46 CHECKL(buffer->arena == buffer->pool->arena);
47 CHECKL(RingCheck(&buffer->poolRing)); /* design.mps.check.type.no-sig */ 47 CHECKL(RingCheck(&buffer->poolRing)); /* <design/check/#type.no-sig> */
48 CHECKL(BoolCheck(buffer->isMutator)); 48 CHECKL(BoolCheck(buffer->isMutator));
49 CHECKL(buffer->fillSize >= 0.0); 49 CHECKL(buffer->fillSize >= 0.0);
50 CHECKL(buffer->emptySize >= 0.0); 50 CHECKL(buffer->emptySize >= 0.0);
@@ -102,7 +102,7 @@ Bool BufferCheck(Buffer buffer)
102 102
103 /* .lwcheck: If LW frames are enabled, the buffer may become */ 103 /* .lwcheck: If LW frames are enabled, the buffer may become */
104 /* trapped asynchronously. It can't become untrapped */ 104 /* trapped asynchronously. It can't become untrapped */
105 /* asynchronously, though. See design.mps.alloc-frame.lw-frame.pop. */ 105 /* asynchronously, though. See <design/alloc-frame/#lw-frame.pop>. */
106 /* Read a snapshot value of the limit field. Use this to determine */ 106 /* Read a snapshot value of the limit field. Use this to determine */
107 /* if we are trapped, and to permit more useful checking when not */ 107 /* if we are trapped, and to permit more useful checking when not */
108 /* yet trapped. */ 108 /* yet trapped. */
@@ -252,7 +252,7 @@ failInit:
252 252
253/* BufferCreate -- create an allocation buffer 253/* BufferCreate -- create an allocation buffer
254 * 254 *
255 * See design.mps.buffer.method.create. */ 255 * See <design/buffer/#method.create>. */
256 256
257Res BufferCreate(Buffer *bufferReturn, BufferClass class, 257Res BufferCreate(Buffer *bufferReturn, BufferClass class,
258 Pool pool, Bool isMutator, ...) 258 Pool pool, Bool isMutator, ...)
@@ -269,7 +269,7 @@ Res BufferCreate(Buffer *bufferReturn, BufferClass class,
269 269
270/* BufferCreateV -- create an allocation buffer, with varargs 270/* BufferCreateV -- create an allocation buffer, with varargs
271 * 271 *
272 * See design.mps.buffer.method.create. */ 272 * See <design/buffer/#method.create>. */
273 273
274Res BufferCreateV(Buffer *bufferReturn, BufferClass class, 274Res BufferCreateV(Buffer *bufferReturn, BufferClass class,
275 Pool pool, Bool isMutator, va_list args) 275 Pool pool, Bool isMutator, va_list args)
@@ -360,7 +360,7 @@ void BufferDetach(Buffer buffer, Pool pool)
360 360
361/* BufferDestroy -- destroy an allocation buffer 361/* BufferDestroy -- destroy an allocation buffer
362 * 362 *
363 * See design.mps.buffer.method.destroy. */ 363 * See <design/buffer/#method.destroy>. */
364 364
365void BufferDestroy(Buffer buffer) 365void BufferDestroy(Buffer buffer)
366{ 366{
@@ -390,7 +390,7 @@ void BufferFinish(Buffer buffer)
390 AVER((pool->class->attr & AttrBUF)); /* .trans.mod */ 390 AVER((pool->class->attr & AttrBUF)); /* .trans.mod */
391 AVER(BufferIsReady(buffer)); 391 AVER(BufferIsReady(buffer));
392 392
393 /* design.mps.alloc-frame.lw-frame.sync.trip */ 393 /* <design/alloc-frame/#lw-frame.sync.trip> */
394 if (BufferIsTrappedByMutator(buffer)) { 394 if (BufferIsTrappedByMutator(buffer)) {
395 BufferFrameNotifyPopPending(buffer); 395 BufferFrameNotifyPopPending(buffer);
396 } 396 }
@@ -473,7 +473,7 @@ static void BufferSetUnflipped(Buffer buffer)
473/* BufferFrameState 473/* BufferFrameState
474 * 474 *
475 * Returns the frame state of a buffer. See 475 * Returns the frame state of a buffer. See
476 * design.mps.alloc-frame.lw-frame.states. */ 476 * <design/alloc-frame/#lw-frame.states>. */
477 477
478FrameState BufferFrameState(Buffer buffer) 478FrameState BufferFrameState(Buffer buffer)
479{ 479{
@@ -496,7 +496,7 @@ FrameState BufferFrameState(Buffer buffer)
496/* BufferFrameSetState 496/* BufferFrameSetState
497 * 497 *
498 * Sets the frame state of a buffer. Only the mutator may set the 498 * Sets the frame state of a buffer. Only the mutator may set the
499 * PopPending state. See design.mps.alloc-frame.lw-frame.states. */ 499 * PopPending state. See <design/alloc-frame/#lw-frame.states>. */
500 500
501void BufferFrameSetState(Buffer buffer, FrameState state) 501void BufferFrameSetState(Buffer buffer, FrameState state)
502{ 502{
@@ -529,7 +529,7 @@ void BufferSetAllocAddr(Buffer buffer, Addr addr)
529 * 529 *
530 * Notifies the pool when a lightweight frame pop operation has been 530 * Notifies the pool when a lightweight frame pop operation has been
531 * deferred and needs to be processed. See 531 * deferred and needs to be processed. See
532 * design.mps.alloc-frame.lw-frame.sync.trip. */ 532 * <design/alloc-frame/#lw-frame.sync.trip>. */
533 533
534static void BufferFrameNotifyPopPending(Buffer buffer) 534static void BufferFrameNotifyPopPending(Buffer buffer)
535{ 535{
@@ -553,7 +553,7 @@ static void BufferFrameNotifyPopPending(Buffer buffer)
553 553
554/* BufferFramePush 554/* BufferFramePush
555 * 555 *
556 * See design.mps.alloc-frame. */ 556 * See <design/alloc-frame/>. */
557 557
558Res BufferFramePush(AllocFrame *frameReturn, Buffer buffer) 558Res BufferFramePush(AllocFrame *frameReturn, Buffer buffer)
559{ 559{
@@ -581,7 +581,7 @@ Res BufferFramePush(AllocFrame *frameReturn, Buffer buffer)
581 581
582/* BufferFramePop 582/* BufferFramePop
583 * 583 *
584 * See design.mps.alloc-frame. */ 584 * See <design/alloc-frame/>. */
585 585
586Res BufferFramePop(Buffer buffer, AllocFrame frame) 586Res BufferFramePop(Buffer buffer, AllocFrame frame)
587{ 587{
@@ -659,7 +659,7 @@ void BufferAttach(Buffer buffer, Addr base, Addr limit,
659 filled = AddrOffset(init, limit); 659 filled = AddrOffset(init, limit);
660 buffer->fillSize += filled; 660 buffer->fillSize += filled;
661 if (buffer->isMutator) { 661 if (buffer->isMutator) {
662 if (base != init) { /* see design.mps.buffer.count.alloc.how */ 662 if (base != init) { /* see <design/buffer/#count.alloc.how> */
663 Size prealloc = AddrOffset(base, init); 663 Size prealloc = AddrOffset(base, init);
664 ArenaGlobals(buffer->arena)->allocMutatorSize -= prealloc; 664 ArenaGlobals(buffer->arena)->allocMutatorSize -= prealloc;
665 } 665 }
@@ -708,7 +708,7 @@ Res BufferFill(Addr *pReturn, Buffer buffer, Size size,
708 BufferSetUnflipped(buffer); 708 BufferSetUnflipped(buffer);
709 } 709 }
710 710
711 /* design.mps.alloc-frame.lw-frame.sync.trip */ 711 /* <design/alloc-frame/#lw-frame.sync.trip> */
712 if (BufferIsTrappedByMutator(buffer)) { 712 if (BufferIsTrappedByMutator(buffer)) {
713 BufferFrameNotifyPopPending(buffer); 713 BufferFrameNotifyPopPending(buffer);
714 } 714 }
@@ -764,7 +764,7 @@ Bool BufferCommit(Buffer buffer, Addr p, Size size)
764 AVER(SizeIsAligned(size, BufferPool(buffer)->alignment)); 764 AVER(SizeIsAligned(size, BufferPool(buffer)->alignment));
765 AVER(!BufferIsReady(buffer)); 765 AVER(!BufferIsReady(buffer));
766 766
767 /* See design.mps.collection.flip. */ 767 /* See <design/collection/#flip>. */
768 /* .commit.before: If a flip occurs before this point, when the */ 768 /* .commit.before: If a flip occurs before this point, when the */
769 /* pool reads "initAtFlip" it will point below the object, so it */ 769 /* pool reads "initAtFlip" it will point below the object, so it */
770 /* will be trashed and the commit must fail when trip is called. */ 770 /* will be trashed and the commit must fail when trip is called. */
@@ -972,7 +972,7 @@ Bool BufferIsTrapped(Buffer buffer)
972/* BufferIsTrappedByMutator 972/* BufferIsTrappedByMutator
973 * 973 *
974 * Indicates whether the mutator trapped the buffer. See 974 * Indicates whether the mutator trapped the buffer. See
975 * design.mps.alloc-frame.lw-frame.sync.trip and .ap.async. */ 975 * <design/alloc-frame/#lw-frame.sync.trip> and .ap.async. */
976 976
977Bool BufferIsTrappedByMutator(Buffer buffer) 977Bool BufferIsTrappedByMutator(Buffer buffer)
978{ 978{
@@ -1207,7 +1207,7 @@ Bool BufferClassCheck(BufferClass class)
1207 1207
1208/* BufferClass -- the vanilla buffer class definition 1208/* BufferClass -- the vanilla buffer class definition
1209 * 1209 *
1210 * See design.mps.buffer.class.hierarchy.buffer. */ 1210 * See <design/buffer/#class.hierarchy.buffer>. */
1211 1211
1212DEFINE_CLASS(BufferClass, class) 1212DEFINE_CLASS(BufferClass, class)
1213{ 1213{
@@ -1458,7 +1458,7 @@ static Res segBufDescribe(Buffer buffer, mps_lib_FILE *stream)
1458/* SegBufClass -- SegBuf class definition 1458/* SegBufClass -- SegBuf class definition
1459 * 1459 *
1460 * Supports an association with a single segment when attached. See 1460 * Supports an association with a single segment when attached. See
1461 * design.mps.buffer.class.hierarchy.segbuf. */ 1461 * <design/buffer/#class.hierarchy.segbuf>. */
1462 1462
1463typedef BufferClassStruct SegBufClassStruct; 1463typedef BufferClassStruct SegBufClassStruct;
1464 1464
diff --git a/mps/code/cbs.c b/mps/code/cbs.c
index 3ea8e263938..1fc89960a5a 100644
--- a/mps/code/cbs.c
+++ b/mps/code/cbs.c
@@ -9,7 +9,7 @@
9 * .purpose: CBSs are used to manage potentially unbounded 9 * .purpose: CBSs are used to manage potentially unbounded
10 * collections of memory blocks. 10 * collections of memory blocks.
11 * 11 *
12 * .sources: design.mps.cbs. 12 * .sources: <design/cbs/>.
13 */ 13 */
14 14
15#include "cbs.h" 15#include "cbs.h"
@@ -22,7 +22,7 @@
22SRCID(cbs, "$Id$"); 22SRCID(cbs, "$Id$");
23 23
24 24
25/* See design.mps.cbs.align */ 25/* See <design/cbs/#align> */
26#define cbsMinimumAlignment ((Align)sizeof(void *)) 26#define cbsMinimumAlignment ((Align)sizeof(void *))
27 27
28#define cbsOfSplayTree(tree) PARENT(CBSStruct, splayTree, (tree)) 28#define cbsOfSplayTree(tree) PARENT(CBSStruct, splayTree, (tree))
@@ -34,7 +34,7 @@ SRCID(cbs, "$Id$");
34 34
35/* CBSEmergencyBlock* -- Getters and setters for emergency blocks 35/* CBSEmergencyBlock* -- Getters and setters for emergency blocks
36 * 36 *
37 * See design.mps.cbs.impl.low-mem.inline.block. 37 * See <design/cbs/#impl.low-mem.inline.block>.
38 */ 38 */
39 39
40#define CBSEmergencyBlockBase(block) ((Addr)(block)) 40#define CBSEmergencyBlockBase(block) ((Addr)(block))
@@ -51,7 +51,7 @@ SRCID(cbs, "$Id$");
51 51
52/* CBSEmergencyGrain* -- Getters and setters for emergency grains 52/* CBSEmergencyGrain* -- Getters and setters for emergency grains
53 * 53 *
54 * See design.mps.cbs.impl.low-mem.inline.grain. 54 * See <design/cbs/#impl.low-mem.inline.grain>.
55 */ 55 */
56 56
57#define CBSEmergencyGrainBase(grain) ((Addr)(grain)) 57#define CBSEmergencyGrainBase(grain) ((Addr)(grain))
@@ -125,7 +125,7 @@ Bool CBSCheck(CBS cbs)
125 CHECKL(cbs->shrink == NULL || FUNCHECK(cbs->shrink)); 125 CHECKL(cbs->shrink == NULL || FUNCHECK(cbs->shrink));
126 CHECKL(cbs->mayUseInline || cbs->emergencyBlockList == NULL); 126 CHECKL(cbs->mayUseInline || cbs->emergencyBlockList == NULL);
127 CHECKL(cbs->mayUseInline || cbs->emergencyGrainList == NULL); 127 CHECKL(cbs->mayUseInline || cbs->emergencyGrainList == NULL);
128 /* See design.mps.cbs.align */ 128 /* See <design/cbs/#align> */
129 CHECKL(!cbs->mayUseInline || 129 CHECKL(!cbs->mayUseInline ||
130 AlignIsAligned(cbs->alignment, cbsMinimumAlignment)); 130 AlignIsAligned(cbs->alignment, cbsMinimumAlignment));
131 /* can't check emergencyBlockList or emergencyGrainList more */ 131 /* can't check emergencyBlockList or emergencyGrainList more */
@@ -136,7 +136,7 @@ Bool CBSCheck(CBS cbs)
136} 136}
137 137
138 138
139/* CBSBlockCheck -- See design.mps.cbs.function.cbs.block.check */ 139/* CBSBlockCheck -- See <design/cbs/#function.cbs.block.check> */
140 140
141Bool CBSBlockCheck(CBSBlock block) 141Bool CBSBlockCheck(CBSBlock block)
142{ 142{
@@ -153,7 +153,7 @@ Bool CBSBlockCheck(CBSBlock block)
153} 153}
154 154
155 155
156/* CBSBlockSize -- see design.mps.cbs.function.cbs.block.size */ 156/* CBSBlockSize -- see <design/cbs/#function.cbs.block.size> */
157 157
158Size (CBSBlockSize)(CBSBlock block) 158Size (CBSBlockSize)(CBSBlock block)
159{ 159{
@@ -164,7 +164,7 @@ Size (CBSBlockSize)(CBSBlock block)
164 164
165/* cbsSplayCompare -- Compare key to [base,limit) 165/* cbsSplayCompare -- Compare key to [base,limit)
166 * 166 *
167 * See design.mps.splay.type.splay.compare.method 167 * See <design/splay/#type.splay.compare.method>
168 */ 168 */
169 169
170static Compare cbsSplayCompare(void *key, SplayNode node) 170static Compare cbsSplayCompare(void *key, SplayNode node)
@@ -268,7 +268,7 @@ static void cbsUpdateNode(SplayTree tree, SplayNode node,
268 268
269/* CBSInit -- Initialise a CBS structure 269/* CBSInit -- Initialise a CBS structure
270 * 270 *
271 * See design.mps.cbs.function.cbs.init. 271 * See <design/cbs/#function.cbs.init>.
272 */ 272 */
273 273
274Res CBSInit(Arena arena, CBS cbs, void *owner, 274Res CBSInit(Arena arena, CBS cbs, void *owner,
@@ -284,7 +284,7 @@ Res CBSInit(Arena arena, CBS cbs, void *owner,
284 AVER(delete == NULL || FUNCHECK(delete)); 284 AVER(delete == NULL || FUNCHECK(delete));
285 AVER(BoolCheck(mayUseInline)); 285 AVER(BoolCheck(mayUseInline));
286 if (mayUseInline) { 286 if (mayUseInline) {
287 /* See design.mps.cbs.align */ 287 /* See <design/cbs/#align> */
288 if (!AlignIsAligned(alignment, cbsMinimumAlignment)) 288 if (!AlignIsAligned(alignment, cbsMinimumAlignment))
289 return ResPARAM; 289 return ResPARAM;
290 } 290 }
@@ -327,7 +327,7 @@ Res CBSInit(Arena arena, CBS cbs, void *owner,
327 327
328/* CBSFinish -- Finish a CBS structure 328/* CBSFinish -- Finish a CBS structure
329 * 329 *
330 * See design.mps.cbs.function.cbs.finish. 330 * See <design/cbs/#function.cbs.finish>.
331 */ 331 */
332 332
333void CBSFinish(CBS cbs) 333void CBSFinish(CBS cbs)
@@ -521,7 +521,7 @@ static Res cbsInsertIntoTree(Addr *baseReturn, Addr *limitReturn,
521 Size oldRightSize = CBSBlockSize(rightCBS); 521 Size oldRightSize = CBSBlockSize(rightCBS);
522 522
523 /* must block larger neighbour and destroy smaller neighbour; */ 523 /* must block larger neighbour and destroy smaller neighbour; */
524 /* see design.mps.cbs.function.cbs.insert.callback */ 524 /* see <design/cbs/#function.cbs.insert.callback> */
525 if (oldLeftSize >= oldRightSize) { 525 if (oldLeftSize >= oldRightSize) {
526 Addr rightLimit = rightCBS->limit; 526 Addr rightLimit = rightCBS->limit;
527 cbsBlockDelete(cbs, rightCBS); 527 cbsBlockDelete(cbs, rightCBS);
@@ -700,7 +700,7 @@ static Res cbsAddToEmergencyLists(CBS cbs, Addr base, Addr limit)
700 AVER(cbs->mayUseInline); 700 AVER(cbs->mayUseInline);
701 701
702 size = AddrOffset(base, limit); 702 size = AddrOffset(base, limit);
703 /* Use the block list if possible. See design.mps.cbs.align. */ 703 /* Use the block list if possible. See <design/cbs/#align>. */
704 if (size > cbsMinimumAlignment) { 704 if (size > cbsMinimumAlignment) {
705 CBSEmergencyBlock prev, block, new; 705 CBSEmergencyBlock prev, block, new;
706 new = CBSEmergencyBlockInit(base, limit); 706 new = CBSEmergencyBlockInit(base, limit);
@@ -834,7 +834,7 @@ static void cbsFlushEmergencyLists(CBS cbs)
834 834
835/* CBSInsert -- Insert a range into the CBS 835/* CBSInsert -- Insert a range into the CBS
836 * 836 *
837 * See design.mps.cbs.functions.cbs.insert. 837 * See <design/cbs/#functions.cbs.insert>.
838 */ 838 */
839 839
840Res CBSInsertReturningRange(Addr *baseReturn, Addr *limitReturn, 840Res CBSInsertReturningRange(Addr *baseReturn, Addr *limitReturn,
@@ -946,7 +946,7 @@ static Res cbsDeleteFromTree(CBS cbs, Addr base, Addr limit)
946 Size leftNewSize = AddrOffset(cbsBlock->base, base); 946 Size leftNewSize = AddrOffset(cbsBlock->base, base);
947 Size rightNewSize = AddrOffset(limit, cbsBlock->limit); 947 Size rightNewSize = AddrOffset(limit, cbsBlock->limit);
948 /* must shrink larger fragment and create smaller; */ 948 /* must shrink larger fragment and create smaller; */
949 /* see design.mps.cbs.function.cbs.delete.callback */ 949 /* see <design/cbs/#function.cbs.delete.callback> */
950 if (leftNewSize >= rightNewSize) { 950 if (leftNewSize >= rightNewSize) {
951 Addr oldLimit = cbsBlock->limit; 951 Addr oldLimit = cbsBlock->limit;
952 AVER(limit < cbsBlock->limit); 952 AVER(limit < cbsBlock->limit);
@@ -1090,7 +1090,7 @@ static Res cbsDeleteFromEmergencyGrainList(CBS cbs, Addr base, Addr limit)
1090 1090
1091/* CBSDelete -- Remove a range from a CBS 1091/* CBSDelete -- Remove a range from a CBS
1092 * 1092 *
1093 * See design.mps.cbs.function.cbs.delete. 1093 * See <design/cbs/#function.cbs.delete>.
1094 */ 1094 */
1095 1095
1096Res CBSDelete(CBS cbs, Addr base, Addr limit) 1096Res CBSDelete(CBS cbs, Addr base, Addr limit)
@@ -1157,7 +1157,7 @@ static Res CBSSplayNodeDescribe(SplayNode splayNode, mps_lib_FILE *stream)
1157/* CBSIterate -- Iterate all blocks in CBS 1157/* CBSIterate -- Iterate all blocks in CBS
1158 * 1158 *
1159 * This is not necessarily efficient. 1159 * This is not necessarily efficient.
1160 * See design.mps.cbs.function.cbs.iterate. 1160 * See <design/cbs/#function.cbs.iterate>.
1161 */ 1161 */
1162 1162
1163/* Internal version without enter/leave checking. */ 1163/* Internal version without enter/leave checking. */
@@ -1246,7 +1246,7 @@ void CBSIterateLarge(CBS cbs, CBSIterateMethod iterate, void *closureP)
1246/* CBSSetMinSize -- Set minimum interesting size for cbs 1246/* CBSSetMinSize -- Set minimum interesting size for cbs
1247 * 1247 *
1248 * This function may invoke the shrink and grow methods as 1248 * This function may invoke the shrink and grow methods as
1249 * appropriate. See design.mps.cbs.function.cbs.set.min-size. 1249 * appropriate. See <design/cbs/#function.cbs.set.min-size>.
1250 */ 1250 */
1251 1251
1252typedef struct { 1252typedef struct {
@@ -1628,7 +1628,7 @@ Bool CBSFindLargest(Addr *baseReturn, Addr *limitReturn,
1628 1628
1629/* CBSDescribe -- describe a CBS 1629/* CBSDescribe -- describe a CBS
1630 * 1630 *
1631 * See design.mps.cbs.function.cbs.describe. 1631 * See <design/cbs/#function.cbs.describe>.
1632 */ 1632 */
1633 1633
1634Res CBSDescribe(CBS cbs, mps_lib_FILE *stream) 1634Res CBSDescribe(CBS cbs, mps_lib_FILE *stream)
diff --git a/mps/code/cbs.h b/mps/code/cbs.h
index 452b7c2ef30..85f13082c27 100644
--- a/mps/code/cbs.h
+++ b/mps/code/cbs.h
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .source: design.mps.cbs. 6 * .source: <design/cbs/>.
7 */ 7 */
8 8
9#ifndef cbs_h 9#ifndef cbs_h
@@ -21,10 +21,10 @@ typedef void (*CBSChangeSizeMethod)(CBS cbs, CBSBlock block,
21typedef Bool (*CBSIterateMethod)(CBS cbs, CBSBlock block, void *closureP); 21typedef Bool (*CBSIterateMethod)(CBS cbs, CBSBlock block, void *closureP);
22 22
23 23
24/* See design.mps.cbs.impl.low-mem.inline.block */ 24/* See <design/cbs/#impl.low-mem.inline.block> */
25typedef void **CBSEmergencyBlock; /* next, limit */ 25typedef void **CBSEmergencyBlock; /* next, limit */
26 26
27/* See design.mps.cbs.impl.low-mem.inline.block */ 27/* See <design/cbs/#impl.low-mem.inline.block> */
28typedef void **CBSEmergencyGrain; /* next */ 28typedef void **CBSEmergencyGrain; /* next */
29 29
30 30
@@ -87,9 +87,9 @@ extern void CBSSetMinSize(CBS cbs, Size minSize);
87extern Res CBSDescribe(CBS cbs, mps_lib_FILE *stream); 87extern Res CBSDescribe(CBS cbs, mps_lib_FILE *stream);
88extern Res CBSBlockDescribe(CBSBlock block, mps_lib_FILE *stream); 88extern Res CBSBlockDescribe(CBSBlock block, mps_lib_FILE *stream);
89 89
90/* CBSBlockBase -- See design.mps.cbs.function.cbs.block.base */ 90/* CBSBlockBase -- See <design/cbs/#function.cbs.block.base> */
91#define CBSBlockBase(block) ((block)->base) 91#define CBSBlockBase(block) ((block)->base)
92/* CBSBlockLimit -- See design.mps.cbs.function.cbs.block.limit */ 92/* CBSBlockLimit -- See <design/cbs/#function.cbs.block.limit> */
93#define CBSBlockLimit(block) ((block)->limit) 93#define CBSBlockLimit(block) ((block)->limit)
94#define CBSBlockSize(block) AddrOffset((block)->base, (block)->limit) 94#define CBSBlockSize(block) AddrOffset((block)->base, (block)->limit)
95extern Size (CBSBlockSize)(CBSBlock block); 95extern Size (CBSBlockSize)(CBSBlock block);
diff --git a/mps/code/check.h b/mps/code/check.h
index b30e27e719b..84a87592ba6 100644
--- a/mps/code/check.h
+++ b/mps/code/check.h
@@ -111,8 +111,8 @@ extern void AssertFail1(const char *s);
111 111
112/* CHECKT -- check type simply 112/* CHECKT -- check type simply
113 * 113 *
114 * Must be thread safe. See design.mps.interface.c.thread-safety 114 * Must be thread safe. See <design/interface-c/#thread-safety>
115 * and design.mps.interface.c.check.space. 115 * and <design/interface-c/#check.space>.
116 */ 116 */
117 117
118#define CHECKT(type, val) ((val) != NULL && (val)->sig == type ## Sig) 118#define CHECKT(type, val) ((val) != NULL && (val)->sig == type ## Sig)
diff --git a/mps/code/config.h b/mps/code/config.h
index 0886f9686f0..3691e24c0ac 100644
--- a/mps/code/config.h
+++ b/mps/code/config.h
@@ -14,7 +14,7 @@
14 * 14 *
15 * DESIGN 15 * DESIGN
16 * 16 *
17 * See design.mps.config. 17 * See <design/config/>.
18 */ 18 */
19 19
20#ifndef config_h 20#ifndef config_h
@@ -24,7 +24,7 @@
24/* Variety Configuration 24/* Variety Configuration
25 * 25 *
26 * Convert CONFIG_VAR_* defined on compiler command line into 26 * Convert CONFIG_VAR_* defined on compiler command line into
27 * internal configuration parameters. See design.mps.config.var 27 * internal configuration parameters. See <design/config/#var>
28 * and design.mps.variety.macro. Note that MPS_HOT is subclassed 28 * and design.mps.variety.macro. Note that MPS_HOT is subclassed
29 * into MPS_HOT_RED and MPS_HOT_WHITE; this distinction should 29 * into MPS_HOT_RED and MPS_HOT_WHITE; this distinction should
30 * be rarely used. 30 * be rarely used.
@@ -253,7 +253,7 @@
253/* Product Configuration 253/* Product Configuration
254 * 254 *
255 * Convert CONFIG_PROD_* defined on compiler command line into 255 * Convert CONFIG_PROD_* defined on compiler command line into
256 * internal configuration parameters. See design.mps.config.prod. 256 * internal configuration parameters. See <design/config/#prod>.
257 */ 257 */
258 258
259#if defined(CONFIG_PROD_EPCORE) 259#if defined(CONFIG_PROD_EPCORE)
diff --git a/mps/code/dbgpool.c b/mps/code/dbgpool.c
index 5a1ba300a87..7254dc95f25 100644
--- a/mps/code/dbgpool.c
+++ b/mps/code/dbgpool.c
@@ -136,7 +136,7 @@ static Res DebugPoolInit(Pool pool, va_list args)
136 /* fencepost init */ 136 /* fencepost init */
137 /* @@@@ This parses a user argument, options, so it should really */ 137 /* @@@@ This parses a user argument, options, so it should really */
138 /* go through the MPS interface. The template needs to be copied */ 138 /* go through the MPS interface. The template needs to be copied */
139 /* into Addr memory, to avoid breaking design.mps.type.addr.use. */ 139 /* into Addr memory, to avoid breaking <design/type/#addr.use>. */
140 debug->fenceSize = options->fenceSize; 140 debug->fenceSize = options->fenceSize;
141 if (debug->fenceSize != 0) { 141 if (debug->fenceSize != 0) {
142 if (debug->fenceSize % PoolAlignment(pool) != 0) { 142 if (debug->fenceSize % PoolAlignment(pool) != 0) {
@@ -413,7 +413,7 @@ static void TagWalk(Pool pool, ObjectsStepMethod step, void *p)
413{ 413{
414 SplayNode node; 414 SplayNode node;
415 PoolDebugMixin debug; 415 PoolDebugMixin debug;
416 Addr dummy = NULL; /* Breaks design.mps.type.addr.use, but it's */ 416 Addr dummy = NULL; /* Breaks <design/type/#addr.use>, but it's */
417 /* only temporary until SplayTreeFirst is fixed. */ 417 /* only temporary until SplayTreeFirst is fixed. */
418 418
419 AVERT(Pool, pool); 419 AVERT(Pool, pool);
@@ -481,7 +481,7 @@ void mps_pool_check_fenceposts(mps_pool_t mps_pool)
481 Pool pool = (Pool)mps_pool; 481 Pool pool = (Pool)mps_pool;
482 Arena arena; 482 Arena arena;
483 483
484 /* CHECKT not AVERT, see design.mps.interface.c.check.space */ 484 /* CHECKT not AVERT, see <design/interface-c/#check.space> */
485 AVER(CHECKT(Pool, pool)); 485 AVER(CHECKT(Pool, pool));
486 arena = PoolArena(pool); 486 arena = PoolArena(pool);
487 487
diff --git a/mps/code/event.h b/mps/code/event.h
index d49c1efffb3..26538c91e6e 100644
--- a/mps/code/event.h
+++ b/mps/code/event.h
@@ -9,7 +9,7 @@
9 * 9 *
10 * DESIGN 10 * DESIGN
11 * 11 *
12 * .design: design.mps.telemetry. 12 * .design: <design/telemetry/>.
13 */ 13 */
14 14
15#ifndef event_h 15#ifndef event_h
@@ -34,7 +34,7 @@ extern void EventLabelAddr(Addr, Word);
34extern Res EventFlush(void); 34extern Res EventFlush(void);
35 35
36 36
37/* Event Kinds --- see design.mps.telemetry 37/* Event Kinds --- see <design/telemetry/>
38 * 38 *
39 * All events are classified as being of one event type. 39 * All events are classified as being of one event type.
40 * They are small enough to be able to be used as shifts within a word. 40 * They are small enough to be able to be used as shifts within a word.
diff --git a/mps/code/eventcom.h b/mps/code/eventcom.h
index 72165a3fe23..79c87c7d46d 100644
--- a/mps/code/eventcom.h
+++ b/mps/code/eventcom.h
@@ -45,7 +45,7 @@ typedef EventUnion *Event;
45#endif 45#endif
46 46
47 47
48/* Event types -- see design.mps.telemetry 48/* Event types -- see <design/telemetry/>
49 * 49 *
50 * These names are intended to be mnemonic. They are derived from 50 * These names are intended to be mnemonic. They are derived from
51 * selected letters as indicated, using the transliteration in 51 * selected letters as indicated, using the transliteration in
diff --git a/mps/code/eventdef.h b/mps/code/eventdef.h
index 88a656a3e60..9f312ff2a45 100644
--- a/mps/code/eventdef.h
+++ b/mps/code/eventdef.h
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .source: design.mps.telemetry 6 * .source: <design/telemetry/>
7 * 7 *
8 * .desc: This file declares relationships that define the various 8 * .desc: This file declares relationships that define the various
9 * event types. It is intended to be used with clever definitions 9 * event types. It is intended to be used with clever definitions
diff --git a/mps/code/finalcv.c b/mps/code/finalcv.c
index 801dbd294e4..b9dc50602c6 100644
--- a/mps/code/finalcv.c
+++ b/mps/code/finalcv.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * DESIGN 6 * DESIGN
7 * 7 *
8 * See design.mps.poolmrg.test. 8 * See <design/poolmrg/#test>.
9 * 9 *
10 * DEPENDENCIES 10 * DEPENDENCIES
11 * 11 *
@@ -104,7 +104,7 @@ static void *test(void *arg, size_t s)
104 "root_create\n"); 104 "root_create\n");
105 die(mps_ap_create(&ap, amc, MPS_RANK_EXACT), "ap_create\n"); 105 die(mps_ap_create(&ap, amc, MPS_RANK_EXACT), "ap_create\n");
106 106
107 /* design.mps.poolmrg.test.promise.ut.alloc */ 107 /* <design/poolmrg/#test.promise.ut.alloc> */
108 for(i = 0; i < rootCOUNT; ++i) { 108 for(i = 0; i < rootCOUNT; ++i) {
109 do { 109 do {
110 MPS_RESERVE_BLOCK(e, p, ap, slotSIZE); 110 MPS_RESERVE_BLOCK(e, p, ap, slotSIZE);
@@ -117,7 +117,7 @@ static void *test(void *arg, size_t s)
117 } 117 }
118 p = NULL; 118 p = NULL;
119 119
120 /* design.mps.poolmrg.test.promise.ut.drop */ 120 /* <design/poolmrg/#test.promise.ut.drop> */
121 for(i = 0; i < rootCOUNT; ++i) { 121 for(i = 0; i < rootCOUNT; ++i) {
122 if (rnd() % 2 == 0) 122 if (rnd() % 2 == 0)
123 root[i] = NULL; 123 root[i] = NULL;
@@ -125,7 +125,7 @@ static void *test(void *arg, size_t s)
125 125
126 mps_message_type_enable(arena, mps_message_type_finalization()); 126 mps_message_type_enable(arena, mps_message_type_finalization());
127 127
128 /* design.mps.poolmrg.test.promise.ut.churn */ 128 /* <design/poolmrg/#test.promise.ut.churn> */
129 while(mps_collections(arena) < 3) { 129 while(mps_collections(arena) < 3) {
130 churn(ap); 130 churn(ap);
131 while(mps_message_poll(arena)) { 131 while(mps_message_poll(arena)) {
@@ -133,21 +133,21 @@ static void *test(void *arg, size_t s)
133 mps_word_t objind; 133 mps_word_t objind;
134 mps_addr_t objaddr; 134 mps_addr_t objaddr;
135 135
136 /* design.mps.poolmrg.test.promise.ut.message */ 136 /* <design/poolmrg/#test.promise.ut.message> */
137 cdie(mps_message_get(&message, arena, mps_message_type_finalization()), 137 cdie(mps_message_get(&message, arena, mps_message_type_finalization()),
138 "get"); 138 "get");
139 mps_message_finalization_ref(&objaddr, arena, message); 139 mps_message_finalization_ref(&objaddr, arena, message);
140 obj = objaddr; 140 obj = objaddr;
141 objind = dylan_int_int(obj[2]); 141 objind = dylan_int_int(obj[2]);
142 printf("Finalizing: object %lu at %p\n", objind, objaddr); 142 printf("Finalizing: object %lu at %p\n", objind, objaddr);
143 /* design.mps.poolmrg.test.promise.ut.final.check */ 143 /* <design/poolmrg/#test.promise.ut.final.check> */
144 cdie(root[objind] == NULL, "died"); 144 cdie(root[objind] == NULL, "died");
145 root[objind] = objaddr; 145 root[objind] = objaddr;
146 mps_message_discard(arena, message); 146 mps_message_discard(arena, message);
147 } 147 }
148 } 148 }
149 149
150 /* @@@@ design.mps.poolmrg.test.promise.ut.nofinal.check missing */ 150 /* @@@@ <design/poolmrg/#test.promise.ut.nofinal.check> missing */
151 151
152 mps_ap_destroy(ap); 152 mps_ap_destroy(ap);
153 mps_root_destroy(mps_root[1]); 153 mps_root_destroy(mps_root[1]);
diff --git a/mps/code/format.c b/mps/code/format.c
index 0ba8527f3c7..76dd4f33d65 100644
--- a/mps/code/format.c
+++ b/mps/code/format.c
@@ -122,7 +122,7 @@ void FormatDestroy(Format format)
122} 122}
123 123
124 124
125/* Must be thread safe. See design.mps.interface.c.thread-safety. */ 125/* Must be thread safe. See <design/interface-c/#thread-safety>. */
126Arena FormatArena(Format format) 126Arena FormatArena(Format format)
127{ 127{
128 /* Can't AVER format as that would not be thread-safe */ 128 /* Can't AVER format as that would not be thread-safe */
diff --git a/mps/code/global.c b/mps/code/global.c
index 3e3f26fa4e5..3bede9d3d6f 100644
--- a/mps/code/global.c
+++ b/mps/code/global.c
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .sources: See design.mps.arena. design.mps.thread-safety is relevant 6 * .sources: See <design/arena/>. design.mps.thread-safety is relevant
7 * to the functions ArenaEnter and ArenaLeave in this file. 7 * to the functions ArenaEnter and ArenaLeave in this file.
8 * 8 *
9 * 9 *
@@ -11,7 +11,7 @@
11 * 11 *
12 * .static: Static data is used in ArenaAccess (in order to find the 12 * .static: Static data is used in ArenaAccess (in order to find the
13 * appropriate arena) and GlobalsInit. It's checked in GlobalsCheck. 13 * appropriate arena) and GlobalsInit. It's checked in GlobalsCheck.
14 * See design.mps.arena.static. 14 * See <design/arena/#static>.
15 * 15 *
16 * .non-mod: The Globals structure has many fields which properly belong 16 * .non-mod: The Globals structure has many fields which properly belong
17 * to other modules (see impl.h.mpmst); GlobalsInit contains code which 17 * to other modules (see impl.h.mpmst); GlobalsInit contains code which
@@ -32,9 +32,9 @@ SRCID(global, "$Id$");
32 32
33/* All static data objects are declared here. See .static */ 33/* All static data objects are declared here. See .static */
34 34
35/* design.mps.arena.static.ring.init */ 35/* <design/arena/#static.ring.init> */
36static Bool arenaRingInit = FALSE; 36static Bool arenaRingInit = FALSE;
37static RingStruct arenaRing; /* design.mps.arena.static.ring */ 37static RingStruct arenaRing; /* <design/arena/#static.ring> */
38 38
39 39
40/* ArenaControlPool -- get the control pool */ 40/* ArenaControlPool -- get the control pool */
@@ -44,7 +44,7 @@ static RingStruct arenaRing; /* design.mps.arena.static.ring */
44 44
45/* arenaClaimRingLock, arenaReleaseRingLock -- lock/release the arena ring 45/* arenaClaimRingLock, arenaReleaseRingLock -- lock/release the arena ring
46 * 46 *
47 * See design.mps.arena.static.ring.lock. */ 47 * See <design/arena/#static.ring.lock>. */
48 48
49static void arenaClaimRingLock(void) 49static void arenaClaimRingLock(void)
50{ 50{
@@ -171,11 +171,11 @@ Bool GlobalsCheck(Globals arenaGlobals)
171 CHECKL(TraceSetSuper(arena->busyTraces, arena->flippedTraces)); 171 CHECKL(TraceSetSuper(arena->busyTraces, arena->flippedTraces));
172 172
173 TRACE_SET_ITER(ti, trace, TraceSetUNIV, arena) 173 TRACE_SET_ITER(ti, trace, TraceSetUNIV, arena)
174 /* design.mps.arena.trace */ 174 /* <design/arena/#trace> */
175 if (TraceSetIsMember(arena->busyTraces, trace)) { 175 if (TraceSetIsMember(arena->busyTraces, trace)) {
176 CHECKD(Trace, trace); 176 CHECKD(Trace, trace);
177 } else { 177 } else {
178 /* design.mps.arena.trace.invalid */ 178 /* <design/arena/#trace.invalid> */
179 CHECKL(trace->sig == SigInvalid); 179 CHECKL(trace->sig == SigInvalid);
180 } 180 }
181 TRACE_SET_ITER_END(ti, trace, TraceSetUNIV, arena); 181 TRACE_SET_ITER_END(ti, trace, TraceSetUNIV, arena);
@@ -197,7 +197,7 @@ Bool GlobalsCheck(Globals arenaGlobals)
197 /* the oldest history entry must be a subset of the prehistory */ 197 /* the oldest history entry must be a subset of the prehistory */
198 CHECKL(RefSetSub(rs, arena->prehistory)); 198 CHECKL(RefSetSub(rs, arena->prehistory));
199 199
200 /* we also check the statics now. design.mps.arena.static.check */ 200 /* we also check the statics now. <design/arena/#static.check> */
201 CHECKL(BoolCheck(arenaRingInit)); 201 CHECKL(BoolCheck(arenaRingInit));
202 CHECKL(RingCheck(&arenaRing)); 202 CHECKL(RingCheck(&arenaRing));
203 203
@@ -224,7 +224,7 @@ Res GlobalsInit(Globals arenaGlobals)
224 /* Ensure static things are initialized. */ 224 /* Ensure static things are initialized. */
225 if (!arenaRingInit) { 225 if (!arenaRingInit) {
226 /* there isn't an arena ring yet */ 226 /* there isn't an arena ring yet */
227 /* design.mps.arena.static.init */ 227 /* <design/arena/#static.init> */
228 arenaRingInit = TRUE; 228 arenaRingInit = TRUE;
229 RingInit(&arenaRing); 229 RingInit(&arenaRing);
230 ProtSetup(); 230 ProtSetup();
@@ -273,7 +273,7 @@ Res GlobalsInit(Globals arenaGlobals)
273 arena->shCache[i] = NULL; 273 arena->shCache[i] = NULL;
274 274
275 for (i=0; i < TraceLIMIT; i++) { 275 for (i=0; i < TraceLIMIT; i++) {
276 /* design.mps.arena.trace.invalid */ 276 /* <design/arena/#trace.invalid> */
277 arena->trace[i].sig = SigInvalid; 277 arena->trace[i].sig = SigInvalid;
278 } 278 }
279 for(rank = 0; rank < RankLIMIT; ++rank) 279 for(rank = 0; rank < RankLIMIT; ++rank)
@@ -306,7 +306,7 @@ Res GlobalsCompleteCreate(Globals arenaGlobals)
306 AVERT(Globals, arenaGlobals); 306 AVERT(Globals, arenaGlobals);
307 arena = GlobalsArena(arenaGlobals); 307 arena = GlobalsArena(arenaGlobals);
308 308
309 /* initialize the message stuff, design.mps.message */ 309 /* initialize the message stuff, <design/message/> */
310 { 310 {
311 void *v; 311 void *v;
312 312
@@ -391,7 +391,7 @@ void GlobalsPrepareToDestroy(Globals arenaGlobals)
391 arena->enabledMessageTypes = NULL; 391 arena->enabledMessageTypes = NULL;
392 } 392 }
393 393
394 /* destroy the final pool (see design.mps.finalize) */ 394 /* destroy the final pool (see <design/finalize/>) */
395 if (arena->isFinalPool) { 395 if (arena->isFinalPool) {
396 /* All this subtlety is because PoolDestroy will call */ 396 /* All this subtlety is because PoolDestroy will call */
397 /* ArenaCheck several times. The invariant on finalPool */ 397 /* ArenaCheck several times. The invariant on finalPool */
@@ -440,7 +440,7 @@ void ArenaLeave(Arena arena)
440{ 440{
441 AVERT(Arena, arena); 441 AVERT(Arena, arena);
442 ShieldLeave(arena); 442 ShieldLeave(arena);
443 ProtSync(arena); /* design.mps.prot.if.sync */ 443 ProtSync(arena); /* <design/prot/#if.sync> */
444 LockReleaseMPM(ArenaGlobals(arena)->lock); 444 LockReleaseMPM(ArenaGlobals(arena)->lock);
445} 445}
446#endif 446#endif
@@ -467,7 +467,7 @@ Bool ArenaAccess(Addr addr, AccessSet mode, MutatorFaultContext context)
467 Ring node, nextNode; 467 Ring node, nextNode;
468 Res res; 468 Res res;
469 469
470 arenaClaimRingLock(); /* design.mps.arena.lock.ring */ 470 arenaClaimRingLock(); /* <design/arena/#lock.ring> */
471 mps_exception_info = context; 471 mps_exception_info = context;
472 AVER(RingCheck(&arenaRing)); 472 AVER(RingCheck(&arenaRing));
473 473
@@ -476,7 +476,7 @@ Bool ArenaAccess(Addr addr, AccessSet mode, MutatorFaultContext context)
476 Arena arena = GlobalsArena(arenaGlobals); 476 Arena arena = GlobalsArena(arenaGlobals);
477 Root root; 477 Root root;
478 478
479 ArenaEnter(arena); /* design.mps.arena.lock.arena */ 479 ArenaEnter(arena); /* <design/arena/#lock.arena> */
480 /* @@@@ The code below assumes that Roots and Segs are disjoint. */ 480 /* @@@@ The code below assumes that Roots and Segs are disjoint. */
481 /* It will fall over (in TraceSegAccess probably) if there is a */ 481 /* It will fall over (in TraceSegAccess probably) if there is a */
482 /* protected root on a segment. */ 482 /* protected root on a segment. */
@@ -582,7 +582,7 @@ Bool ArenaStep(Globals globals, double interval)
582 582
583/* ArenaFinalize -- registers an object for finalization 583/* ArenaFinalize -- registers an object for finalization
584 * 584 *
585 * See design.mps.finalize. */ 585 * See <design/finalize/>. */
586 586
587Res ArenaFinalize(Arena arena, Ref obj) 587Res ArenaFinalize(Arena arena, Ref obj)
588{ 588{
diff --git a/mps/code/lock.h b/mps/code/lock.h
index 09b23e882a3..b32b5ed4a73 100644
--- a/mps/code/lock.h
+++ b/mps/code/lock.h
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .description: [@@@@ Should be combined with design.mps.lock] 6 * .description: [@@@@ Should be combined with <design/lock/>]
7 * This defines the type Lock, which supports simple recursive 7 * This defines the type Lock, which supports simple recursive
8 * locking. Locking ensures that only a single thread may be running 8 * locking. Locking ensures that only a single thread may be running
9 * with a lock held. By claiming a lock in some code, this ensures 9 * with a lock held. By claiming a lock in some code, this ensures
diff --git a/mps/code/lockan.c b/mps/code/lockan.c
index 329743186f4..a2256404583 100644
--- a/mps/code/lockan.c
+++ b/mps/code/lockan.c
@@ -18,7 +18,7 @@ SRCID(lockan, "$Id$");
18 18
19 19
20typedef struct LockStruct { /* ANSI fake lock structure */ 20typedef struct LockStruct { /* ANSI fake lock structure */
21 Sig sig; /* design.mps.sig */ 21 Sig sig; /* <design/sig/> */
22 unsigned long claims; /* # claims held by owner */ 22 unsigned long claims; /* # claims held by owner */
23} LockStruct; 23} LockStruct;
24 24
diff --git a/mps/code/lockfr.c b/mps/code/lockfr.c
index 4b1c2708eb6..af4ebc5e508 100644
--- a/mps/code/lockfr.c
+++ b/mps/code/lockfr.c
@@ -43,7 +43,7 @@ SRCID(lockfr, "$Id$");
43 */ 43 */
44 44
45typedef struct LockStruct { 45typedef struct LockStruct {
46 Sig sig; /* design.mps.sig */ 46 Sig sig; /* <design/sig/> */
47 unsigned long claims; /* # claims held by owner */ 47 unsigned long claims; /* # claims held by owner */
48 pthread_mutex_t mut; /* the mutex itself */ 48 pthread_mutex_t mut; /* the mutex itself */
49} LockStruct; 49} LockStruct;
diff --git a/mps/code/lockli.c b/mps/code/lockli.c
index 7516fd669da..dc117172941 100644
--- a/mps/code/lockli.c
+++ b/mps/code/lockli.c
@@ -65,7 +65,7 @@ SRCID(lockli, "$Id$");
65 */ 65 */
66 66
67typedef struct LockStruct { 67typedef struct LockStruct {
68 Sig sig; /* design.mps.sig */ 68 Sig sig; /* <design/sig/> */
69 unsigned long claims; /* # claims held by owner */ 69 unsigned long claims; /* # claims held by owner */
70 pthread_mutex_t mut; /* the mutex itself */ 70 pthread_mutex_t mut; /* the mutex itself */
71} LockStruct; 71} LockStruct;
diff --git a/mps/code/lockw3.c b/mps/code/lockw3.c
index cd3f5c91db0..161bb6ac1de 100644
--- a/mps/code/lockw3.c
+++ b/mps/code/lockw3.c
@@ -34,7 +34,7 @@ SRCID(lockw3, "$Id$");
34 34
35/* .lock.win32: Win32 lock structure; uses CRITICAL_SECTION */ 35/* .lock.win32: Win32 lock structure; uses CRITICAL_SECTION */
36typedef struct LockStruct { 36typedef struct LockStruct {
37 Sig sig; /* design.mps.sig */ 37 Sig sig; /* <design/sig/> */
38 unsigned long claims; /* # claims held by the owning thread */ 38 unsigned long claims; /* # claims held by the owning thread */
39 CRITICAL_SECTION cs; /* Win32's recursive lock thing */ 39 CRITICAL_SECTION cs; /* Win32's recursive lock thing */
40} LockStruct; 40} LockStruct;
diff --git a/mps/code/locus.c b/mps/code/locus.c
index 2359d4e1b07..2bb655c1d65 100644
--- a/mps/code/locus.c
+++ b/mps/code/locus.c
@@ -5,8 +5,8 @@
5 * 5 *
6 * DESIGN 6 * DESIGN
7 * 7 *
8 * See design.mps.arena.vm and design.mps.locus for basic locus stuff. 8 * See <design/arenavm/> and <design/locus/> for basic locus stuff.
9 * See design.mps.trace for chains. 9 * See <design/trace/> for chains.
10 */ 10 */
11 11
12#include "chain.h" 12#include "chain.h"
diff --git a/mps/code/message.c b/mps/code/message.c
index 196d688dd29..1714a506c0f 100644
--- a/mps/code/message.c
+++ b/mps/code/message.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * DESIGN 6 * DESIGN
7 * 7 *
8 * .design: See design.mps.message (it really exists). 8 * .design: See <design/message/> (it really exists).
9 * 9 *
10 * PURPOSE 10 * PURPOSE
11 * 11 *
@@ -136,7 +136,7 @@ void MessagePost(Arena arena, Message message)
136 AVERT(Message, message); 136 AVERT(Message, message);
137 137
138 /* queueRing field must be a singleton, see */ 138 /* queueRing field must be a singleton, see */
139 /* design.mps.message.fun.post.singleton */ 139 /* <design/message/#fun.post.singleton> */
140 AVER(!MessageOnQueue(message)); 140 AVER(!MessageOnQueue(message));
141 if(MessageTypeEnabled(arena, message->type)) { 141 if(MessageTypeEnabled(arena, message->type)) {
142 RingAppend(&arena->messageRing, &message->queueRing); 142 RingAppend(&arena->messageRing, &message->queueRing);
diff --git a/mps/code/messtest.c b/mps/code/messtest.c
index da3d6236a34..b3ba19435ea 100644
--- a/mps/code/messtest.c
+++ b/mps/code/messtest.c
@@ -35,7 +35,7 @@ static MessageClassStruct DFMessageClassStruct = {
35 MessageNoGCLiveSize, /* GCLiveSize */ 35 MessageNoGCLiveSize, /* GCLiveSize */
36 MessageNoGCCondemnedSize, /* GCCondemnedSize */ 36 MessageNoGCCondemnedSize, /* GCCondemnedSize */
37 MessageNoGCNotCondemnedSize, /* GCNoteCondemnedSize */ 37 MessageNoGCNotCondemnedSize, /* GCNoteCondemnedSize */
38 MessageClassSig /* design.mps.message.class.sig.double */ 38 MessageClassSig /* <design/message/#class.sig.double> */
39}; 39};
40 40
41 41
@@ -49,7 +49,7 @@ static MessageClassStruct DGCMessageClassStruct = {
49 MessageNoGCLiveSize, /* GCLiveSize */ 49 MessageNoGCLiveSize, /* GCLiveSize */
50 MessageNoGCCondemnedSize, /* GCCondemnedSize */ 50 MessageNoGCCondemnedSize, /* GCCondemnedSize */
51 MessageNoGCNotCondemnedSize, /* GCNoteCondemnedSize */ 51 MessageNoGCNotCondemnedSize, /* GCNoteCondemnedSize */
52 MessageClassSig /* design.mps.message.class.sig.double */ 52 MessageClassSig /* <design/message/#class.sig.double> */
53}; 53};
54 54
55 55
diff --git a/mps/code/misc.h b/mps/code/misc.h
index 5c3bcdfbb59..89851f6918f 100644
--- a/mps/code/misc.h
+++ b/mps/code/misc.h
@@ -15,7 +15,7 @@
15#include <stddef.h> 15#include <stddef.h>
16 16
17 17
18typedef int Bool; /* design.mps.type.bool */ 18typedef int Bool; /* <design/type/#bool> */
19enum { 19enum {
20 FALSE = 0, 20 FALSE = 0,
21 TRUE = 1 21 TRUE = 1
diff --git a/mps/code/mpm.c b/mps/code/mpm.c
index a561dbd2b45..ba74cb50c98 100644
--- a/mps/code/mpm.c
+++ b/mps/code/mpm.c
@@ -6,7 +6,7 @@
6 * .purpose: Miscellaneous support for the implementation of the MPM 6 * .purpose: Miscellaneous support for the implementation of the MPM
7 * and pool classes. 7 * and pool classes.
8 * 8 *
9 * .sources: design.mps.writef */ 9 * .sources: <design/writef/> */
10 10
11#include "mpm.h" 11#include "mpm.h"
12#include <stdarg.h> 12#include <stdarg.h>
@@ -393,7 +393,7 @@ static Res WriteDouble(mps_lib_FILE *stream, double d)
393 393
394/* WriteF -- write formatted output 394/* WriteF -- write formatted output
395 * 395 *
396 * .writef.des: See design.mps.writef, also design.mps.lib 396 * .writef.des: See <design/writef/>, also <design/lib/>
397 * 397 *
398 * .writef.p: There is an assumption that void * fits in Word in 398 * .writef.p: There is an assumption that void * fits in Word in
399 * the case of $P, and unsigned long for $U and $B. This is checked in 399 * the case of $P, and unsigned long for $U and $B. This is checked in
diff --git a/mps/code/mpm.h b/mps/code/mpm.h
index d5273db9d7c..b18a9b76fa7 100644
--- a/mps/code/mpm.h
+++ b/mps/code/mpm.h
@@ -32,7 +32,7 @@ extern Bool MPMCheck(void);
32 32
33/* Miscellaneous Checks -- see impl.c.mpm */ 33/* Miscellaneous Checks -- see impl.c.mpm */
34 34
35/* design.mps.type.bool.check */ 35/* <design/type/#bool.check> */
36#define BoolCheck(b) ((unsigned)(b) <= 1) 36#define BoolCheck(b) ((unsigned)(b) <= 1)
37 37
38extern Bool FunCheck(Fun f); 38extern Bool FunCheck(Fun f);
@@ -100,7 +100,7 @@ extern Addr (AddrAlignDown)(Addr addr, Align align);
100 100
101extern Addr (AddrSet)(Addr target, Byte value, Size size); 101extern Addr (AddrSet)(Addr target, Byte value, Size size);
102/* This is one of the places that implements Addr, so it's allowed to */ 102/* This is one of the places that implements Addr, so it's allowed to */
103/* convert to void *, see design.mps.type.addr.ops.mem. */ 103/* convert to void *, see <design/type/#addr.ops.mem>. */
104#define AddrSet(target, value, size) \ 104#define AddrSet(target, value, size) \
105 mps_lib_memset(target, (int)(value), size) 105 mps_lib_memset(target, (int)(value), size)
106 106
@@ -139,7 +139,7 @@ extern Shift SizeLog2(Size size);
139extern Shift SizeFloorLog2(Size size); 139extern Shift SizeFloorLog2(Size size);
140 140
141 141
142/* Formatted Output -- see design.mps.writef, impl.c.mpm */ 142/* Formatted Output -- see <design/writef/>, impl.c.mpm */
143 143
144extern Res WriteF(mps_lib_FILE *stream, ...); 144extern Res WriteF(mps_lib_FILE *stream, ...);
145 145
@@ -151,33 +151,33 @@ extern size_t StringLength(const char *s);
151 151
152/* Version Determination 152/* Version Determination
153 * 153 *
154 * See design.mps.version-library. */ 154 * See <design/version/>-library. */
155 155
156extern char *MPSVersion(void); 156extern char *MPSVersion(void);
157 157
158 158
159/* Bit Table Interface -- see design.mps.bt.if.* for doc */ 159/* Bit Table Interface -- see <design/bt/#if>.* for doc */
160 160
161/* design.mps.bt.if.size */ 161/* <design/bt/#if.size> */
162extern size_t (BTSize)(unsigned long length); 162extern size_t (BTSize)(unsigned long length);
163#define BTSize(n) (((n) + MPS_WORD_WIDTH-1) / MPS_WORD_WIDTH * sizeof(Word)) 163#define BTSize(n) (((n) + MPS_WORD_WIDTH-1) / MPS_WORD_WIDTH * sizeof(Word))
164 164
165 165
166/* design.mps.bt.if.get */ 166/* <design/bt/#if.get> */
167extern Bool (BTGet)(BT bt, Index index); 167extern Bool (BTGet)(BT bt, Index index);
168#define BTGet(a, i) \ 168#define BTGet(a, i) \
169 ((Bool)(((a)[((i) >> MPS_WORD_SHIFT)] \ 169 ((Bool)(((a)[((i) >> MPS_WORD_SHIFT)] \
170 >> ((i) & ~((Word)-1 << MPS_WORD_SHIFT))) \ 170 >> ((i) & ~((Word)-1 << MPS_WORD_SHIFT))) \
171 & (Word)1)) 171 & (Word)1))
172 172
173/* design.mps.bt.if.set */ 173/* <design/bt/#if.set> */
174extern void (BTSet)(BT bt, Index index); 174extern void (BTSet)(BT bt, Index index);
175#define BTSet(a, i) \ 175#define BTSet(a, i) \
176 BEGIN \ 176 BEGIN \
177 (a)[((i)>>MPS_WORD_SHIFT)] |= (Word)1<<((i)&~((Word)-1<<MPS_WORD_SHIFT)); \ 177 (a)[((i)>>MPS_WORD_SHIFT)] |= (Word)1<<((i)&~((Word)-1<<MPS_WORD_SHIFT)); \
178 END 178 END
179 179
180/* design.mps.bt.if.res */ 180/* <design/bt/#if.res> */
181extern void (BTRes)(BT bt, Index index); 181extern void (BTRes)(BT bt, Index index);
182#define BTRes(a, i) \ 182#define BTRes(a, i) \
183 BEGIN \ 183 BEGIN \
@@ -323,7 +323,7 @@ extern AbstractCollectPoolClass AbstractCollectPoolClassGet(void);
323 323
324/* DEFINE_POOL_CLASS 324/* DEFINE_POOL_CLASS
325 * 325 *
326 * Convenience macro -- see design.mps.protocol.int.define-special. */ 326 * Convenience macro -- see <design/protocol/#int.define-special>. */
327 327
328#define DEFINE_POOL_CLASS(className, var) \ 328#define DEFINE_POOL_CLASS(className, var) \
329 DEFINE_ALIAS_CLASS(className, PoolClass, var) 329 DEFINE_ALIAS_CLASS(className, PoolClass, var)
@@ -332,7 +332,7 @@ extern AbstractCollectPoolClass AbstractCollectPoolClassGet(void);
332 ((PoolClass)SUPERCLASS(className)) 332 ((PoolClass)SUPERCLASS(className))
333 333
334 334
335/* Message Interface -- see design.mps.message */ 335/* Message Interface -- see <design/message/> */
336 336
337extern Bool MessageCheck(Message message); 337extern Bool MessageCheck(Message message);
338extern Bool MessageClassCheck(MessageClass class); 338extern Bool MessageClassCheck(MessageClass class);
@@ -467,7 +467,7 @@ extern void TraceScanSingleRef(TraceSet ts, Rank rank, Arena arena,
467 467
468/* DEFINE_ARENA_CLASS 468/* DEFINE_ARENA_CLASS
469 * 469 *
470 * Convenience macro -- see design.mps.protocol.int.define-special. */ 470 * Convenience macro -- see <design/protocol/#int.define-special>. */
471 471
472#define DEFINE_ARENA_CLASS(className, var) \ 472#define DEFINE_ARENA_CLASS(className, var) \
473 DEFINE_ALIAS_CLASS(className, ArenaClass, var) 473 DEFINE_ALIAS_CLASS(className, ArenaClass, var)
@@ -868,12 +868,12 @@ extern void (ShieldFlush)(Arena arena);
868 868
869/* Protection Interface 869/* Protection Interface
870 * 870 *
871 * See design.mps.prot for the design of the generic interface including 871 * See <design/prot/> for the design of the generic interface including
872 * the contracts for these functions. 872 * the contracts for these functions.
873 * 873 *
874 * This interface has several different implementations, typically one 874 * This interface has several different implementations, typically one
875 * per platform, see impl.c.prot* for the various implementations, and 875 * per platform, see impl.c.prot* for the various implementations, and
876 * design.mps.prot* for the corresponding designs. */ 876 * <design/prot/>* for the corresponding designs. */
877 877
878extern void ProtSetup(void); 878extern void ProtSetup(void);
879 879
diff --git a/mps/code/mpmst.h b/mps/code/mpmst.h
index 12994ef60b3..673fd36e5a4 100644
--- a/mps/code/mpmst.h
+++ b/mps/code/mpmst.h
@@ -15,7 +15,7 @@
15 * .rationale.sig: Object signatures (PoolSig, etc.) are defined here, 15 * .rationale.sig: Object signatures (PoolSig, etc.) are defined here,
16 * along with the structures, so that any code which can see a structure 16 * along with the structures, so that any code which can see a structure
17 * can also check its signature before using any of its fields. See 17 * can also check its signature before using any of its fields. See
18 * design.mps.sig.test.uniq to check that signatures are unique. */ 18 * <design/sig/#test.uniq> to check that signatures are unique. */
19 19
20#ifndef mpmst_h 20#ifndef mpmst_h
21#define mpmst_h 21#define mpmst_h
@@ -30,11 +30,11 @@
30 30
31/* PoolClassStruct -- pool class structure 31/* PoolClassStruct -- pool class structure
32 * 32 *
33 * See design.mps.pool. 33 * See <design/pool/>.
34 * 34 *
35 * .class: The pool class structure is defined by each pool class 35 * .class: The pool class structure is defined by each pool class
36 * implementation in order to provide an interface between the MPM 36 * implementation in order to provide an interface between the MPM
37 * and the class (see design.mps.class-interface) via generic 37 * and the class (see <design/class-interface/>) via generic
38 * functions (see impl.c.pool). A class XXX defines a function 38 * functions (see impl.c.pool). A class XXX defines a function
39 * PoolClassXXX() returning a PoolClass pointing to a PoolClassStruct 39 * PoolClassXXX() returning a PoolClass pointing to a PoolClassStruct
40 * of methods which implement the memory management policy. 40 * of methods which implement the memory management policy.
@@ -86,12 +86,12 @@ typedef struct PoolClassStruct {
86 * a "subclass" of the pool structure (the "outer structure") which 86 * a "subclass" of the pool structure (the "outer structure") which
87 * contains PoolStruct as a a field. The outer structure holds the 87 * contains PoolStruct as a a field. The outer structure holds the
88 * class-specific part of the pool's state. See impl.c.pool, 88 * class-specific part of the pool's state. See impl.c.pool,
89 * design.mps.pool. */ 89 * <design/pool/>. */
90 90
91#define PoolSig ((Sig)0x519B0019) /* SIGnature POOL */ 91#define PoolSig ((Sig)0x519B0019) /* SIGnature POOL */
92 92
93typedef struct PoolStruct { /* generic structure */ 93typedef struct PoolStruct { /* generic structure */
94 Sig sig; /* design.mps.sig */ 94 Sig sig; /* <design/sig/> */
95 Serial serial; /* from arena->poolSerial */ 95 Serial serial; /* from arena->poolSerial */
96 PoolClass class; /* pool class structure */ 96 PoolClass class; /* pool class structure */
97 Arena arena; /* owning arena */ 97 Arena arena; /* owning arena */
@@ -111,14 +111,14 @@ typedef struct PoolStruct { /* generic structure */
111 111
112/* MFSStruct -- MFS (Manual Fixed Small) pool outer structure 112/* MFSStruct -- MFS (Manual Fixed Small) pool outer structure
113 * 113 *
114 * .mfs: See impl.c.poolmfs, design.mps.poolmfs. 114 * .mfs: See impl.c.poolmfs, <design/poolmfs/>.
115 * 115 *
116 * The MFS outer structure is declared here because it is inlined 116 * The MFS outer structure is declared here because it is inlined
117 * in the control pool structure which is inlined in the arena. Normally, 117 * in the control pool structure which is inlined in the arena. Normally,
118 * pool outer structures are declared with the pools. 118 * pool outer structures are declared with the pools.
119 * 119 *
120 * The signature is placed at the end, see 120 * The signature is placed at the end, see
121 * design.mps.pool.outer-structure.sig. */ 121 * <design/pool/#outer-structure.sig>. */
122 122
123#define MFSSig ((Sig)0x5193F599) /* SIGnature MFS */ 123#define MFSSig ((Sig)0x5193F599) /* SIGnature MFS */
124 124
@@ -130,13 +130,13 @@ typedef struct MFSStruct { /* MFS outer structure */
130 Word unitsPerExtent; /* number of units per arena alloc */ 130 Word unitsPerExtent; /* number of units per arena alloc */
131 struct MFSHeaderStruct *freeList; /* head of the free list */ 131 struct MFSHeaderStruct *freeList; /* head of the free list */
132 Tract tractList; /* the first tract */ 132 Tract tractList; /* the first tract */
133 Sig sig; /* design.mps.sig */ 133 Sig sig; /* <design/sig/> */
134} MFSStruct; 134} MFSStruct;
135 135
136 136
137/* MVStruct -- MV (Manual Variable) pool outer structure 137/* MVStruct -- MV (Manual Variable) pool outer structure
138 * 138 *
139 * .mv: See impl.c.poolmv, design.mps.poolmv. 139 * .mv: See impl.c.poolmv, <design/poolmv/>.
140 * 140 *
141 * The MV pool outer structure is declared here because it is the 141 * The MV pool outer structure is declared here because it is the
142 * control pool structure which is inlined in the arena. Normally, 142 * control pool structure which is inlined in the arena. Normally,
@@ -152,15 +152,15 @@ typedef struct MVStruct { /* MV pool outer structure */
152 Size avgSize; /* client estimate of allocation size */ 152 Size avgSize; /* client estimate of allocation size */
153 Size maxSize; /* client estimate of maximum size */ 153 Size maxSize; /* client estimate of maximum size */
154 Size space; /* total free space in pool */ 154 Size space; /* total free space in pool */
155 Size lost; /* design.mps.poolmv.lost */ 155 Size lost; /* <design/poolmv/#lost> */
156 RingStruct spans; /* span chain */ 156 RingStruct spans; /* span chain */
157 Sig sig; /* design.mps.sig */ 157 Sig sig; /* <design/sig/> */
158} MVStruct; 158} MVStruct;
159 159
160 160
161/* ReservoirStruct -- Reservoir structure 161/* ReservoirStruct -- Reservoir structure
162 * 162 *
163 * .reservoir: See impl.c.reserv, design.mps.reservoir. 163 * .reservoir: See impl.c.reserv, <design/reservoir/>.
164 * 164 *
165 * The Reservoir structure is declared here because it is in-lined in 165 * The Reservoir structure is declared here because it is in-lined in
166 * the arena for storing segments for the low-memory reservoir. It is 166 * the arena for storing segments for the low-memory reservoir. It is
@@ -175,19 +175,19 @@ typedef struct ReservoirStruct { /* Reservoir structure */
175 Tract reserve; /* linked list of reserve tracts */ 175 Tract reserve; /* linked list of reserve tracts */
176 Size reservoirLimit; /* desired reservoir size */ 176 Size reservoirLimit; /* desired reservoir size */
177 Size reservoirSize; /* actual reservoir size */ 177 Size reservoirSize; /* actual reservoir size */
178 Sig sig; /* design.mps.sig */ 178 Sig sig; /* <design/sig/> */
179} ReservoirStruct; 179} ReservoirStruct;
180 180
181 181
182/* MessageClassStruct -- Message Class structure 182/* MessageClassStruct -- Message Class structure
183 * 183 *
184 * See design.mps.message.class.struct (and design.mps.message.message, 184 * See <design/message/#class.struct> (and <design/message/#message>,
185 * and design.mps.message.class). */ 185 * and <design/message/#class>). */
186 186
187#define MessageClassSig ((Sig)0x519359c1) /* SIGnature MeSsaGe CLass */ 187#define MessageClassSig ((Sig)0x519359c1) /* SIGnature MeSsaGe CLass */
188 188
189typedef struct MessageClassStruct { 189typedef struct MessageClassStruct {
190 Sig sig; /* design.mps.sig */ 190 Sig sig; /* <design/sig/> */
191 const char *name; /* Human readable Class name */ 191 const char *name; /* Human readable Class name */
192 192
193 /* generic methods */ 193 /* generic methods */
@@ -201,17 +201,17 @@ typedef struct MessageClassStruct {
201 MessageGCCondemnedSizeMethod gcCondemnedSize; 201 MessageGCCondemnedSizeMethod gcCondemnedSize;
202 MessageGCNotCondemnedSizeMethod gcNotCondemnedSize; 202 MessageGCNotCondemnedSizeMethod gcNotCondemnedSize;
203 203
204 Sig endSig; /* design.mps.message.class.sig.double */ 204 Sig endSig; /* <design/message/#class.sig.double> */
205} MessageClassStruct; 205} MessageClassStruct;
206 206
207#define MessageSig ((Sig)0x5193e559) /* SIG MESSaGe */ 207#define MessageSig ((Sig)0x5193e559) /* SIG MESSaGe */
208 208
209/* MessageStruct -- Message structure 209/* MessageStruct -- Message structure
210 * 210 *
211 * See design.mps.message.message.struct. */ 211 * See <design/message/#message.struct>. */
212 212
213typedef struct MessageStruct { 213typedef struct MessageStruct {
214 Sig sig; /* design.mps.sig */ 214 Sig sig; /* <design/sig/> */
215 Arena arena; /* owning arena */ 215 Arena arena; /* owning arena */
216 MessageType type; /* Message Type */ 216 MessageType type; /* Message Type */
217 MessageClass class; /* Message Class Structure */ 217 MessageClass class; /* Message Class Structure */
@@ -221,7 +221,7 @@ typedef struct MessageStruct {
221 221
222/* SegClassStruct -- segment class structure 222/* SegClassStruct -- segment class structure
223 * 223 *
224 * See design.mps.seg & design.mps.protocol. 224 * See <design/seg/> & <design/protocol/>.
225 * 225 *
226 * .seg.class: The segment class structure is defined by each segment 226 * .seg.class: The segment class structure is defined by each segment
227 * class implementation in order to provide a generic interface to 227 * class implementation in order to provide a generic interface to
@@ -252,7 +252,7 @@ typedef struct SegClassStruct {
252/* SegStruct -- segment structure 252/* SegStruct -- segment structure
253 * 253 *
254 * .seg: Segments are the basic units of protection and tracer activity 254 * .seg: Segments are the basic units of protection and tracer activity
255 * for allocated memory. See design.mps.seg. */ 255 * for allocated memory. See <design/seg/>. */
256 256
257#define SegSig ((Sig)0x5195E999) /* SIGnature SEG */ 257#define SegSig ((Sig)0x5195E999) /* SIGnature SEG */
258 258
@@ -275,7 +275,7 @@ typedef struct SegStruct { /* segment structure */
275/* GCSegStruct -- GCable segment structure 275/* GCSegStruct -- GCable segment structure
276 * 276 *
277 * .seggc: GCSeg is a subclass of Seg with support for buffered 277 * .seggc: GCSeg is a subclass of Seg with support for buffered
278 * allocation and GC. See design.mps.seg. */ 278 * allocation and GC. See <design/seg/>. */
279 279
280#define GCSegSig ((Sig)0x5199C5E9) /* SIGnature GC SEG */ 280#define GCSegSig ((Sig)0x5199C5E9) /* SIGnature GC SEG */
281 281
@@ -284,7 +284,7 @@ typedef struct GCSegStruct { /* GC segment structure */
284 RingStruct greyRing; /* link in list of grey segs */ 284 RingStruct greyRing; /* link in list of grey segs */
285 RefSet summary; /* summary of references out of seg */ 285 RefSet summary; /* summary of references out of seg */
286 Buffer buffer; /* non-NULL if seg is buffered */ 286 Buffer buffer; /* non-NULL if seg is buffered */
287 Sig sig; /* design.mps.sig */ 287 Sig sig; /* <design/sig/> */
288} GCSegStruct; 288} GCSegStruct;
289 289
290 290
@@ -310,7 +310,7 @@ typedef struct SegPrefStruct { /* segment placement preferences */
310 310
311/* BufferClassStruct -- buffer class structure 311/* BufferClassStruct -- buffer class structure
312 * 312 *
313 * See design.mps.buffer & design.mps.protocol. 313 * See <design/buffer/> & <design/protocol/>.
314 * 314 *
315 * .buffer.class: The buffer class structure is defined by each buffer 315 * .buffer.class: The buffer class structure is defined by each buffer
316 * class implementation in order to provide a generic interface to 316 * class implementation in order to provide a generic interface to
@@ -339,7 +339,7 @@ typedef struct BufferClassStruct {
339 339
340/* APStruct -- allocation point structure 340/* APStruct -- allocation point structure
341 * 341 *
342 * AP are part of the design of buffers see design.mps.buffer. 342 * AP are part of the design of buffers see <design/buffer/>.
343 * 343 *
344 * The allocation point is exported to the client code so that it can 344 * The allocation point is exported to the client code so that it can
345 * do in-line buffered allocation. 345 * do in-line buffered allocation.
@@ -359,14 +359,14 @@ typedef struct APStruct {
359 359
360/* BufferStruct -- allocation buffer structure 360/* BufferStruct -- allocation buffer structure
361 * 361 *
362 * See impl.c.buffer, design.mps.buffer. 362 * See impl.c.buffer, <design/buffer/>.
363 * 363 *
364 * The buffer contains an AP which may be exported to the client. */ 364 * The buffer contains an AP which may be exported to the client. */
365 365
366#define BufferSig ((Sig)0x519B0FFE) /* SIGnature BUFFEr */ 366#define BufferSig ((Sig)0x519B0FFE) /* SIGnature BUFFEr */
367 367
368typedef struct BufferStruct { 368typedef struct BufferStruct {
369 Sig sig; /* design.mps.sig */ 369 Sig sig; /* <design/sig/> */
370 BufferClass class; /* buffer class structure */ 370 BufferClass class; /* buffer class structure */
371 Serial serial; /* from pool->bufferSerial */ 371 Serial serial; /* from pool->bufferSerial */
372 Arena arena; /* owning arena */ 372 Arena arena; /* owning arena */
@@ -396,7 +396,7 @@ typedef struct SegBufStruct {
396 BufferStruct bufferStruct; /* superclass fields must come first */ 396 BufferStruct bufferStruct; /* superclass fields must come first */
397 RankSet rankSet; /* ranks of references being created */ 397 RankSet rankSet; /* ranks of references being created */
398 Seg seg; /* segment being buffered */ 398 Seg seg; /* segment being buffered */
399 Sig sig; /* design.mps.sig */ 399 Sig sig; /* <design/sig/> */
400} SegBufStruct; 400} SegBufStruct;
401 401
402 402
@@ -462,7 +462,7 @@ typedef struct ScanStateStruct {
462 Word zoneShift; /* copy of arena->zoneShift. See .ss.zone */ 462 Word zoneShift; /* copy of arena->zoneShift. See .ss.zone */
463 ZoneSet white; /* white set, for inline fix test */ 463 ZoneSet white; /* white set, for inline fix test */
464 RefSet unfixedSummary; /* accumulated summary of scanned references */ 464 RefSet unfixedSummary; /* accumulated summary of scanned references */
465 Sig sig; /* design.mps.sig */ 465 Sig sig; /* <design/sig/> */
466 Arena arena; /* owning arena */ 466 Arena arena; /* owning arena */
467 TraceSet traces; /* traces to scan for */ 467 TraceSet traces; /* traces to scan for */
468 Rank rank; /* reference rank of scanning */ 468 Rank rank; /* reference rank of scanning */
@@ -487,7 +487,7 @@ typedef struct ScanStateStruct {
487#define TraceSig ((Sig)0x51924ACE) /* SIGnature TRACE */ 487#define TraceSig ((Sig)0x51924ACE) /* SIGnature TRACE */
488 488
489typedef struct TraceStruct { 489typedef struct TraceStruct {
490 Sig sig; /* design.mps.sig */ 490 Sig sig; /* <design/sig/> */
491 TraceId ti; /* index into TraceSets */ 491 TraceId ti; /* index into TraceSets */
492 Arena arena; /* owning arena */ 492 Arena arena; /* owning arena */
493 ZoneSet white; /* zones in the white set */ 493 ZoneSet white; /* zones in the white set */
@@ -580,7 +580,7 @@ typedef struct GlobalsStruct {
580 Lock lock; /* arena's lock */ 580 Lock lock; /* arena's lock */
581 581
582 /* polling fields (impl.c.global) */ 582 /* polling fields (impl.c.global) */
583 double pollThreshold; /* design.mps.arena.poll */ 583 double pollThreshold; /* <design/arena/#poll> */
584 Bool insidePoll; 584 Bool insidePoll;
585 Bool clamped; /* prevent background activity */ 585 Bool clamped; /* prevent background activity */
586 double fillMutatorSize; /* total bytes filled, mutator buffers */ 586 double fillMutatorSize; /* total bytes filled, mutator buffers */
@@ -593,7 +593,7 @@ typedef struct GlobalsStruct {
593 const char *mpsVersionString; /* MPSVersion() */ 593 const char *mpsVersionString; /* MPSVersion() */
594 594
595 /* buffer fields (impl.c.buffer) */ 595 /* buffer fields (impl.c.buffer) */
596 Bool bufferLogging; /* design.mps.buffer.logging.control */ 596 Bool bufferLogging; /* <design/buffer/#logging.control> */
597 597
598 /* pool fields (impl.c.pool) */ 598 /* pool fields (impl.c.pool) */
599 RingStruct poolRing; /* ring of pools in arena */ 599 RingStruct poolRing; /* ring of pools in arena */
@@ -612,15 +612,15 @@ typedef struct GlobalsStruct {
612#define ArenaSig ((Sig)0x519A6E4A) /* SIGnature ARENA */ 612#define ArenaSig ((Sig)0x519A6E4A) /* SIGnature ARENA */
613 613
614typedef struct ArenaStruct { 614typedef struct ArenaStruct {
615 GlobalsStruct globals; /* must be first, see design.mps.arena.globals */ 615 GlobalsStruct globals; /* must be first, see <design/arena/#globals> */
616 Serial serial; 616 Serial serial;
617 617
618 ArenaClass class; /* arena class structure */ 618 ArenaClass class; /* arena class structure */
619 619
620 Bool poolReady; /* design.mps.arena.pool.ready */ 620 Bool poolReady; /* <design/arena/#pool.ready> */
621 MVStruct controlPoolStruct; /* design.mps.arena.pool */ 621 MVStruct controlPoolStruct; /* <design/arena/#pool> */
622 622
623 ReservoirStruct reservoirStruct; /* design.mps.reservoir */ 623 ReservoirStruct reservoirStruct; /* <design/reservoir/> */
624 624
625 Size committed; /* amount of committed RAM */ 625 Size committed; /* amount of committed RAM */
626 Size commitLimit; /* client-configurable commit limit */ 626 Size commitLimit; /* client-configurable commit limit */
@@ -646,11 +646,11 @@ typedef struct ArenaStruct {
646 RingStruct formatRing; /* ring of formats attached to arena */ 646 RingStruct formatRing; /* ring of formats attached to arena */
647 Serial formatSerial; /* serial of next format */ 647 Serial formatSerial; /* serial of next format */
648 648
649 /* message fields (design.mps.message, impl.c.message) */ 649 /* message fields (<design/message/>, impl.c.message) */
650 RingStruct messageRing; /* ring of pending messages */ 650 RingStruct messageRing; /* ring of pending messages */
651 BT enabledMessageTypes; /* map of which types are enabled */ 651 BT enabledMessageTypes; /* map of which types are enabled */
652 652
653 /* finalization fields (design.mps.finalize), impl.c.poolmrg */ 653 /* finalization fields (<design/finalize/>), impl.c.poolmrg */
654 Bool isFinalPool; /* indicator for finalPool */ 654 Bool isFinalPool; /* indicator for finalPool */
655 Pool finalPool; /* either NULL or an MRG pool */ 655 Pool finalPool; /* either NULL or an MRG pool */
656 656
@@ -670,15 +670,15 @@ typedef struct ArenaStruct {
670 TraceSet busyTraces; /* set of running traces */ 670 TraceSet busyTraces; /* set of running traces */
671 TraceSet flippedTraces; /* set of running and flipped traces */ 671 TraceSet flippedTraces; /* set of running and flipped traces */
672 TraceStruct trace[TraceLIMIT]; /* trace structures. See 672 TraceStruct trace[TraceLIMIT]; /* trace structures. See
673 design.mps.trace.intance.limit */ 673 <design/trace/#intance.limit> */
674 RingStruct greyRing[RankLIMIT]; /* ring of grey segments at each rank */ 674 RingStruct greyRing[RankLIMIT]; /* ring of grey segments at each rank */
675 STATISTIC_DECL(Count writeBarrierHitCount); /* write barrier hits */ 675 STATISTIC_DECL(Count writeBarrierHitCount); /* write barrier hits */
676 RingStruct chainRing; /* ring of chains */ 676 RingStruct chainRing; /* ring of chains */
677 677
678 /* location dependency fields (impl.c.ld) */ 678 /* location dependency fields (impl.c.ld) */
679 Epoch epoch; /* design.mps.arena.ld.epoch */ 679 Epoch epoch; /* <design/arena/#ld.epoch> */
680 RefSet prehistory; /* design.mps.arena.ld.prehistory */ 680 RefSet prehistory; /* <design/arena/#ld.prehistory> */
681 RefSet history[LDHistoryLENGTH]; /* design.mps.arena.ld.history */ 681 RefSet history[LDHistoryLENGTH]; /* <design/arena/#ld.history> */
682 682
683 Sig sig; 683 Sig sig;
684} ArenaStruct; 684} ArenaStruct;
diff --git a/mps/code/mpmtypes.h b/mps/code/mpmtypes.h
index 7bcd2f00b5c..a92a38169c4 100644
--- a/mps/code/mpmtypes.h
+++ b/mps/code/mpmtypes.h
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .design: design.mps.type 6 * .design: <design/type/>
7 * 7 *
8 * .rationale: Types and type constants are almost all defined 8 * .rationale: Types and type constants are almost all defined
9 * in this header, in advance of any declarations of prototypes 9 * in this header, in advance of any declarations of prototypes
@@ -24,21 +24,21 @@
24 24
25/* TYPES */ 25/* TYPES */
26 26
27typedef unsigned long Sig; /* design.mps.sig */ 27typedef unsigned long Sig; /* <design/sig/> */
28typedef int Res; /* design.mps.type.res */ 28typedef int Res; /* <design/type/#res> */
29 29
30typedef void (*Fun)(void); /* design.mps.type.fun */ 30typedef void (*Fun)(void); /* <design/type/#fun> */
31typedef MPS_T_WORD Word; /* design.mps.type.word */ 31typedef MPS_T_WORD Word; /* <design/type/#word> */
32typedef unsigned char Byte; /* design.mps.type.byte */ 32typedef unsigned char Byte; /* <design/type/#byte> */
33typedef struct AddrStruct *Addr; /* design.mps.type.addr */ 33typedef struct AddrStruct *Addr; /* <design/type/#addr> */
34typedef Word Size; /* design.mps.type.size */ 34typedef Word Size; /* <design/type/#size> */
35typedef Word Count; /* design.mps.type.count */ 35typedef Word Count; /* <design/type/#count> */
36typedef Word Index; /* design.mps.type.index */ 36typedef Word Index; /* <design/type/#index> */
37typedef Word Align; /* design.mps.type.align */ 37typedef Word Align; /* <design/type/#align> */
38typedef unsigned Shift; /* design.mps.type.shift */ 38typedef unsigned Shift; /* <design/type/#shift> */
39typedef unsigned Serial; /* design.mps.type.serial */ 39typedef unsigned Serial; /* <design/type/#serial> */
40typedef Addr Ref; /* design.mps.type.ref */ 40typedef Addr Ref; /* <design/type/#ref> */
41typedef void *Pointer; /* design.mps.type.pointer */ 41typedef void *Pointer; /* <design/type/#pointer> */
42 42
43typedef Word RefSet; /* design.mps.refset */ 43typedef Word RefSet; /* design.mps.refset */
44typedef Word ZoneSet; /* design.mps.refset */ 44typedef Word ZoneSet; /* design.mps.refset */
@@ -46,28 +46,28 @@ typedef unsigned Rank;
46typedef unsigned RankSet; 46typedef unsigned RankSet;
47typedef unsigned RootMode; 47typedef unsigned RootMode;
48typedef Size Epoch; /* design.mps.ld */ 48typedef Size Epoch; /* design.mps.ld */
49typedef unsigned TraceId; /* design.mps.trace */ 49typedef unsigned TraceId; /* <design/trace/> */
50typedef unsigned TraceSet; /* design.mps.trace */ 50typedef unsigned TraceSet; /* <design/trace/> */
51typedef unsigned TraceState; /* design.mps.trace */ 51typedef unsigned TraceState; /* <design/trace/> */
52typedef unsigned AccessSet; /* design.mps.type.access-set */ 52typedef unsigned AccessSet; /* <design/type/#access-set> */
53typedef unsigned Attr; /* design.mps.type.attr */ 53typedef unsigned Attr; /* <design/type/#attr> */
54typedef unsigned FormatVariety; 54typedef unsigned FormatVariety;
55typedef int RootVar; /* design.mps.type.rootvar */ 55typedef int RootVar; /* <design/type/#rootvar> */
56 56
57typedef Word *BT; /* design.mps.bt */ 57typedef Word *BT; /* <design/bt/> */
58typedef struct BootBlockStruct *BootBlock; /* impl.c.boot */ 58typedef struct BootBlockStruct *BootBlock; /* impl.c.boot */
59typedef struct BufferStruct *Buffer; /* design.mps.buffer */ 59typedef struct BufferStruct *Buffer; /* <design/buffer/> */
60typedef struct SegBufStruct *SegBuf; /* design.mps.buffer */ 60typedef struct SegBufStruct *SegBuf; /* <design/buffer/> */
61typedef struct BufferClassStruct *BufferClass; /* design.mps.buffer */ 61typedef struct BufferClassStruct *BufferClass; /* <design/buffer/> */
62typedef BufferClass SegBufClass; /* design.mps.buffer */ 62typedef BufferClass SegBufClass; /* <design/buffer/> */
63typedef BufferClass RankBufClass; /* design.mps.buffer */ 63typedef BufferClass RankBufClass; /* <design/buffer/> */
64typedef unsigned BufferMode; /* design.mps.buffer */ 64typedef unsigned BufferMode; /* <design/buffer/> */
65typedef unsigned FrameState; /* design.mps.alloc-frame */ 65typedef unsigned FrameState; /* <design/alloc-frame/> */
66typedef struct APStruct *AP; /* design.mps.buffer */ 66typedef struct APStruct *AP; /* <design/buffer/> */
67typedef struct FormatStruct *Format; /* design.mps.format */ 67typedef struct FormatStruct *Format; /* design.mps.format */
68typedef struct LDStruct *LD; /* design.mps.ld */ 68typedef struct LDStruct *LD; /* design.mps.ld */
69typedef struct LockStruct *Lock; /* impl.c.lock* */ 69typedef struct LockStruct *Lock; /* impl.c.lock* */
70typedef struct PoolStruct *Pool; /* design.mps.pool */ 70typedef struct PoolStruct *Pool; /* <design/pool/> */
71typedef struct PoolClassStruct *PoolClass; /* impl.c.poolclas */ 71typedef struct PoolClassStruct *PoolClass; /* impl.c.poolclas */
72typedef PoolClass AbstractPoolClass; /* impl.c.poolabs */ 72typedef PoolClass AbstractPoolClass; /* impl.c.poolabs */
73typedef PoolClass AbstractAllocFreePoolClass; /* impl.c.poolabs */ 73typedef PoolClass AbstractAllocFreePoolClass; /* impl.c.poolabs */
@@ -75,10 +75,10 @@ typedef PoolClass AbstractBufferPoolClass; /* impl.c.poolabs */
75typedef PoolClass AbstractSegBufPoolClass; /* impl.c.poolabs */ 75typedef PoolClass AbstractSegBufPoolClass; /* impl.c.poolabs */
76typedef PoolClass AbstractScanPoolClass; /* impl.c.poolabs */ 76typedef PoolClass AbstractScanPoolClass; /* impl.c.poolabs */
77typedef PoolClass AbstractCollectPoolClass; /* impl.c.poolabs */ 77typedef PoolClass AbstractCollectPoolClass; /* impl.c.poolabs */
78typedef struct TraceStruct *Trace; /* design.mps.trace */ 78typedef struct TraceStruct *Trace; /* <design/trace/> */
79typedef struct ScanStateStruct *ScanState; /* design.mps.trace */ 79typedef struct ScanStateStruct *ScanState; /* <design/trace/> */
80typedef struct ChainStruct *Chain; /* design.mps.trace */ 80typedef struct ChainStruct *Chain; /* <design/trace/> */
81typedef struct TractStruct *Tract; /* design.mps.arena */ 81typedef struct TractStruct *Tract; /* <design/arena/> */
82typedef struct ChunkStruct *Chunk; /* impl.c.tract */ 82typedef struct ChunkStruct *Chunk; /* impl.c.tract */
83typedef struct ChunkCacheEntryStruct *ChunkCacheEntry; /* impl.c.tract */ 83typedef struct ChunkCacheEntryStruct *ChunkCacheEntry; /* impl.c.tract */
84typedef struct PageStruct *Page; /* impl.c.tract */ 84typedef struct PageStruct *Page; /* impl.c.tract */
@@ -88,19 +88,19 @@ typedef struct SegClassStruct *SegClass; /* impl.c.seg */
88typedef SegClass GCSegClass; /* impl.c.seg */ 88typedef SegClass GCSegClass; /* impl.c.seg */
89typedef struct SegPrefStruct *SegPref; /* design.mps.pref, impl.c.locus */ 89typedef struct SegPrefStruct *SegPref; /* design.mps.pref, impl.c.locus */
90typedef int SegPrefKind; /* design.mps.pref, impl.c.locus */ 90typedef int SegPrefKind; /* design.mps.pref, impl.c.locus */
91typedef struct ArenaClassStruct *ArenaClass; /* design.mps.arena */ 91typedef struct ArenaClassStruct *ArenaClass; /* <design/arena/> */
92typedef ArenaClass AbstractArenaClass; /* impl.c.arena */ 92typedef ArenaClass AbstractArenaClass; /* impl.c.arena */
93typedef struct ArenaStruct *Arena; /* design.mps.arena */ 93typedef struct ArenaStruct *Arena; /* <design/arena/> */
94typedef struct GlobalsStruct *Globals; /* design.mps.arena */ 94typedef struct GlobalsStruct *Globals; /* <design/arena/> */
95typedef struct VMStruct *VM; /* impl.c.vm* */ 95typedef struct VMStruct *VM; /* impl.c.vm* */
96typedef struct RootStruct *Root; /* impl.c.root */ 96typedef struct RootStruct *Root; /* impl.c.root */
97typedef struct ThreadStruct *Thread; /* impl.c.th* */ 97typedef struct ThreadStruct *Thread; /* impl.c.th* */
98typedef struct MutatorFaultContextStruct 98typedef struct MutatorFaultContextStruct
99 *MutatorFaultContext; /* design.mps.prot */ 99 *MutatorFaultContext; /* <design/prot/> */
100typedef struct PoolDebugMixinStruct *PoolDebugMixin; 100typedef struct PoolDebugMixinStruct *PoolDebugMixin;
101typedef struct AllocPatternStruct *AllocPattern; 101typedef struct AllocPatternStruct *AllocPattern;
102typedef struct AllocFrameStruct *AllocFrame; /* design.mps.alloc-frame */ 102typedef struct AllocFrameStruct *AllocFrame; /* <design/alloc-frame/> */
103typedef struct ReservoirStruct *Reservoir; /* design.mps.reservoir */ 103typedef struct ReservoirStruct *Reservoir; /* <design/reservoir/> */
104 104
105 105
106/* Arena*Method -- see impl.h.mpmst.ArenaClassStruct */ 106/* Arena*Method -- see impl.h.mpmst.ArenaClassStruct */
@@ -121,7 +121,7 @@ typedef Res (*ArenaDescribeMethod)(Arena arena, mps_lib_FILE *stream);
121 121
122/* Messages 122/* Messages
123 * 123 *
124 * See design.mps.message 124 * See <design/message/>
125 */ 125 */
126 126
127typedef unsigned MessageType; 127typedef unsigned MessageType;
@@ -140,7 +140,7 @@ typedef Res (*TraceFixMethod)(ScanState ss, Ref *refIO);
140typedef void (*FormattedObjectsStepMethod)(Addr, Format, Pool, 140typedef void (*FormattedObjectsStepMethod)(Addr, Format, Pool,
141 void *, Size); 141 void *, Size);
142 142
143/* Seg*Method -- see design.mps.seg */ 143/* Seg*Method -- see <design/seg/> */
144 144
145typedef Res (*SegInitMethod)(Seg seg, Pool pool, Addr base, Size size, 145typedef Res (*SegInitMethod)(Seg seg, Pool pool, Addr base, Size size,
146 Bool withReservoirPermit, va_list args); 146 Bool withReservoirPermit, va_list args);
@@ -161,7 +161,7 @@ typedef Res (*SegSplitMethod)(Seg seg, Seg segHi,
161 Addr base, Addr mid, Addr limit, 161 Addr base, Addr mid, Addr limit,
162 Bool withReservoirPermit, va_list args); 162 Bool withReservoirPermit, va_list args);
163 163
164/* Buffer*Method -- see design.mps.buffer */ 164/* Buffer*Method -- see <design/buffer/> */
165 165
166typedef Res (*BufferInitMethod)(Buffer buffer, Pool pool, va_list args); 166typedef Res (*BufferInitMethod)(Buffer buffer, Pool pool, va_list args);
167typedef void (*BufferFinishMethod)(Buffer buffer); 167typedef void (*BufferFinishMethod)(Buffer buffer);
@@ -175,7 +175,7 @@ typedef void (*BufferReassignSegMethod)(Buffer buffer, Seg seg);
175typedef Res (*BufferDescribeMethod)(Buffer buffer, mps_lib_FILE *stream); 175typedef Res (*BufferDescribeMethod)(Buffer buffer, mps_lib_FILE *stream);
176 176
177 177
178/* Pool*Method -- see design.mps.class-interface */ 178/* Pool*Method -- see <design/class-interface/> */
179 179
180/* Order of types corresponds to PoolClassStruct in impl.h.mpmst */ 180/* Order of types corresponds to PoolClassStruct in impl.h.mpmst */
181 181
@@ -218,7 +218,7 @@ typedef Res (*PoolDescribeMethod)(Pool pool, mps_lib_FILE *stream);
218typedef PoolDebugMixin (*PoolDebugMixinMethod)(Pool pool); 218typedef PoolDebugMixin (*PoolDebugMixinMethod)(Pool pool);
219 219
220 220
221/* Message*Method -- design.mps.message */ 221/* Message*Method -- <design/message/> */
222 222
223typedef void (*MessageDeleteMethod)(Message message); 223typedef void (*MessageDeleteMethod)(Message message);
224typedef void (*MessageFinalizationRefMethod) 224typedef void (*MessageFinalizationRefMethod)
@@ -228,7 +228,7 @@ typedef Size (*MessageGCCondemnedSizeMethod)(Message message);
228typedef Size (*MessageGCNotCondemnedSizeMethod)(Message message); 228typedef Size (*MessageGCNotCondemnedSizeMethod)(Message message);
229 229
230 230
231/* Message Types -- design.mps.message and elsewhere */ 231/* Message Types -- <design/message/> and elsewhere */
232 232
233typedef struct MessageFinalizationStruct *MessageFinalization; 233typedef struct MessageFinalizationStruct *MessageFinalization;
234 234
@@ -246,7 +246,7 @@ typedef void (*FormatPadMethod)(Addr base, Size size);
246typedef Addr (*FormatClassMethod)(Addr object); 246typedef Addr (*FormatClassMethod)(Addr object);
247 247
248 248
249/* Root*Method -- see design.mps.root-interface */ 249/* Root*Method -- see <design/root/>-interface */
250/* .root-methods: These methods must match those defined in the */ 250/* .root-methods: These methods must match those defined in the */
251/* MPS C Interface. (See impl.h.mps.root-methods.) */ 251/* MPS C Interface. (See impl.h.mps.root-methods.) */
252 252
@@ -257,11 +257,11 @@ typedef Res (*RootScanRegMethod)(ScanState ss, Thread thread, void *p, size_t s)
257/* CONSTANTS */ 257/* CONSTANTS */
258 258
259 259
260/* design.mps.sig SIGnature IS BAD */ 260/* <design/sig/> SIGnature IS BAD */
261#define SigInvalid ((Sig)0x51915BAD) 261#define SigInvalid ((Sig)0x51915BAD)
262 262
263#define SizeMAX ((Size)-1) 263#define SizeMAX ((Size)-1)
264#define AccessSetEMPTY ((AccessSet)0) /* design.mps.type.access-set */ 264#define AccessSetEMPTY ((AccessSet)0) /* <design/type/#access-set> */
265#define AccessREAD ((AccessSet)(1<<0)) 265#define AccessREAD ((AccessSet)(1<<0))
266#define AccessWRITE ((AccessSet)(1<<1)) 266#define AccessWRITE ((AccessSet)(1<<1))
267#define AccessSetWIDTH (2) 267#define AccessSetWIDTH (2)
@@ -273,7 +273,7 @@ typedef Res (*RootScanRegMethod)(ScanState ss, Thread thread, void *p, size_t s)
273#define TraceSetUNIV ((TraceSet)((1u << TraceLIMIT) - 1)) 273#define TraceSetUNIV ((TraceSet)((1u << TraceLIMIT) - 1))
274#define RankSetEMPTY BS_EMPTY(RankSet) 274#define RankSetEMPTY BS_EMPTY(RankSet)
275#define RankSetUNIV ((RankSet)((1u << RankLIMIT) - 1)) 275#define RankSetUNIV ((RankSet)((1u << RankLIMIT) - 1))
276#define AttrFMT ((Attr)(1<<0)) /* design.mps.type.attr */ 276#define AttrFMT ((Attr)(1<<0)) /* <design/type/#attr> */
277#define AttrSCAN ((Attr)(1<<1)) 277#define AttrSCAN ((Attr)(1<<1))
278#define AttrPM_NO_READ ((Attr)(1<<2)) 278#define AttrPM_NO_READ ((Attr)(1<<2))
279#define AttrPM_NO_WRITE ((Attr)(1<<3)) 279#define AttrPM_NO_WRITE ((Attr)(1<<3))
@@ -319,7 +319,7 @@ enum {
319#define BufferModeTRANSITION ((BufferMode)(1<<3)) 319#define BufferModeTRANSITION ((BufferMode)(1<<3))
320 320
321 321
322/* Buffer frame states. See design.mps.alloc-frame.lw-frame.states */ 322/* Buffer frame states. See <design/alloc-frame/#lw-frame.states> */
323enum { 323enum {
324 BufferFrameVALID = 1, 324 BufferFrameVALID = 1,
325 BufferFramePOP_PENDING, 325 BufferFramePOP_PENDING,
@@ -327,7 +327,7 @@ enum {
327}; 327};
328 328
329 329
330/* Rank constants -- see design.mps.type.rank */ 330/* Rank constants -- see <design/type/#rank> */
331/* These definitions must match impl.h.mps.rank. */ 331/* These definitions must match impl.h.mps.rank. */
332/* This is checked by impl.c.mpsi.check. */ 332/* This is checked by impl.c.mpsi.check. */
333 333
@@ -350,7 +350,7 @@ enum {
350#define RootModePROTECTABLE_INNER ((RootMode)1<<2) 350#define RootModePROTECTABLE_INNER ((RootMode)1<<2)
351 351
352 352
353/* Root Variants -- see design.mps.type.rootvar 353/* Root Variants -- see <design/type/#rootvar>
354 * 354 *
355 * .rootvar: Synchonize with impl.c.root.rootvarcheck 355 * .rootvar: Synchonize with impl.c.root.rootvarcheck
356 */ 356 */
@@ -365,7 +365,7 @@ enum {
365}; 365};
366 366
367 367
368/* .result-codes: Result Codes -- see design.mps.type.res */ 368/* .result-codes: Result Codes -- see <design/type/#res> */
369/* These definitions must match impl.h.mps.result-codes. */ 369/* These definitions must match impl.h.mps.result-codes. */
370/* This is checked by impl.c.mpsi.check.rc. */ 370/* This is checked by impl.c.mpsi.check.rc. */
371/* Changing this list entails changing the list in */ 371/* Changing this list entails changing the list in */
@@ -384,7 +384,7 @@ enum {
384}; 384};
385 385
386 386
387/* TraceStates -- see design.mps.trace */ 387/* TraceStates -- see <design/trace/> */
388 388
389enum { 389enum {
390 TraceINIT = 1, 390 TraceINIT = 1,
@@ -395,7 +395,7 @@ enum {
395}; 395};
396 396
397 397
398/* MessageTypes -- see design.mps.message */ 398/* MessageTypes -- see <design/message/> */
399/* .message.types: Keep in sync with impl.h.mps.message.types */ 399/* .message.types: Keep in sync with impl.h.mps.message.types */
400 400
401enum { 401enum {
diff --git a/mps/code/mps.h b/mps/code/mps.h
index 823137e8f08..4fc132d7882 100644
--- a/mps/code/mps.h
+++ b/mps/code/mps.h
@@ -4,7 +4,7 @@
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .readership: customers, MPS developers. 6 * .readership: customers, MPS developers.
7 * .sources: design.mps.interface.c. 7 * .sources: <design/interface-c/>.
8 */ 8 */
9 9
10#ifndef mps_h 10#ifndef mps_h
diff --git a/mps/code/mpsi.c b/mps/code/mpsi.c
index ae4e3ae6ecf..a2caccc3a72 100644
--- a/mps/code/mpsi.c
+++ b/mps/code/mpsi.c
@@ -9,7 +9,7 @@
9 * usage of the MPS Interface. .purpose.thread: It excludes multiple 9 * usage of the MPS Interface. .purpose.thread: It excludes multiple
10 * threads from the MPM by locking the Arena (see .thread-safety). 10 * threads from the MPM by locking the Arena (see .thread-safety).
11 * 11 *
12 * .design: design.mps.interface.c 12 * .design: <design/interface-c/>
13 * 13 *
14 * 14 *
15 * NOTES 15 * NOTES
@@ -44,7 +44,7 @@
44 * interface is designed allows for the possibility of change. 44 * interface is designed allows for the possibility of change.
45 * 45 *
46 * .naming: (rule.impl.guide) The exported identifiers do not follow the 46 * .naming: (rule.impl.guide) The exported identifiers do not follow the
47 * normal MPS naming conventions. See design.mps.interface.c.naming. */ 47 * normal MPS naming conventions. See <design/interface-c/#naming>. */
48 48
49#include "mpm.h" 49#include "mpm.h"
50#include "mps.h" 50#include "mps.h"
@@ -91,7 +91,7 @@ static Bool mpsi_check(void)
91 CHECKL((int)MPS_RANK_WEAK == (int)RankWEAK); 91 CHECKL((int)MPS_RANK_WEAK == (int)RankWEAK);
92 92
93 /* The external idea of a word width and the internal one */ 93 /* The external idea of a word width and the internal one */
94 /* had better match. See design.mps.interface.c.cons. */ 94 /* had better match. See <design/interface-c/#cons>. */
95 CHECKL(sizeof(mps_word_t) == sizeof(void *)); 95 CHECKL(sizeof(mps_word_t) == sizeof(void *));
96 CHECKL(CHECKTYPE(mps_word_t, Word)); 96 CHECKL(CHECKTYPE(mps_word_t, Word));
97 97
@@ -100,8 +100,8 @@ static Bool mpsi_check(void)
100 CHECKL(CHECKTYPE(mps_addr_t, Addr)); 100 CHECKL(CHECKTYPE(mps_addr_t, Addr));
101 101
102 /* The external idea of size and the internal one had */ 102 /* The external idea of size and the internal one had */
103 /* better match. See design.mps.interface.c.cons.size */ 103 /* better match. See <design/interface-c/#cons.size> */
104 /* and design.mps.interface.c.pun.size. */ 104 /* and <design/interface-c/#pun.size>. */
105 CHECKL(CHECKTYPE(size_t, Size)); 105 CHECKL(CHECKTYPE(size_t, Size));
106 106
107 /* Check ap_s/APStruct compatibility by hand */ 107 /* Check ap_s/APStruct compatibility by hand */
@@ -146,7 +146,7 @@ static Bool mpsi_check(void)
146 /* are not equal. See impl.h.mpmst.ss. CHECKFIELDAPPROX */ 146 /* are not equal. See impl.h.mpmst.ss. CHECKFIELDAPPROX */
147 /* is used on the fix field because its type is punned and */ 147 /* is used on the fix field because its type is punned and */
148 /* therefore isn't exactly checkable. See */ 148 /* therefore isn't exactly checkable. See */
149 /* design.mps.interface.c.pun.addr. */ 149 /* <design/interface-c/#pun.addr>. */
150 CHECKL(CHECKFIELDAPPROX(mps_ss_s, fix, ScanStateStruct, fix)); 150 CHECKL(CHECKFIELDAPPROX(mps_ss_s, fix, ScanStateStruct, fix));
151 CHECKL(CHECKFIELD(mps_ss_s, w0, ScanStateStruct, zoneShift)); 151 CHECKL(CHECKFIELD(mps_ss_s, w0, ScanStateStruct, zoneShift));
152 CHECKL(CHECKFIELD(mps_ss_s, w1, ScanStateStruct, white)); 152 CHECKL(CHECKFIELD(mps_ss_s, w1, ScanStateStruct, white));
@@ -461,7 +461,7 @@ mps_bool_t mps_arena_has_addr(mps_arena_t mps_arena, mps_addr_t p)
461 * 461 *
462 * .fmt.create.A.purpose: This function converts an object format spec 462 * .fmt.create.A.purpose: This function converts an object format spec
463 * of variant "A" into an MPM Format object. See 463 * of variant "A" into an MPM Format object. See
464 * design.mps.interface.c.fmt.extend for justification of the way that 464 * <design/interface-c/#fmt.extend> for justification of the way that
465 * the format structure is declared as "mps_fmt_A". */ 465 * the format structure is declared as "mps_fmt_A". */
466 466
467mps_res_t mps_fmt_create_A(mps_fmt_t *mps_fmt_o, 467mps_res_t mps_fmt_create_A(mps_fmt_t *mps_fmt_o,
@@ -653,7 +653,7 @@ mps_res_t mps_alloc(mps_addr_t *p_o, mps_pool_t mps_pool, size_t size, ...)
653 AVERT(Pool, pool); 653 AVERT(Pool, pool);
654 AVER(size > 0); 654 AVER(size > 0);
655 /* Note: class may allow unaligned size, see */ 655 /* Note: class may allow unaligned size, see */
656 /* design.mps.class-interface.alloc.size.align. */ 656 /* <design/class-interface/#alloc.size.align>. */
657 /* Rest ignored, see .varargs. */ 657 /* Rest ignored, see .varargs. */
658 658
659 /* @@@@ There is currently no requirement for reservoirs to work */ 659 /* @@@@ There is currently no requirement for reservoirs to work */
@@ -693,7 +693,7 @@ void mps_free(mps_pool_t mps_pool, mps_addr_t p, size_t size)
693 AVER(PoolHasAddr(pool, p)); 693 AVER(PoolHasAddr(pool, p));
694 AVER(size > 0); 694 AVER(size > 0);
695 /* Note: class may allow unaligned size, see */ 695 /* Note: class may allow unaligned size, see */
696 /* design.mps.class-interface.alloc.size.align. */ 696 /* <design/class-interface/#alloc.size.align>. */
697 697
698 PoolFree(pool, (Addr)p, size); 698 PoolFree(pool, (Addr)p, size);
699 ArenaLeave(arena); 699 ArenaLeave(arena);
@@ -852,7 +852,7 @@ mps_bool_t (mps_commit)(mps_ap_t mps_ap, mps_addr_t p, size_t size)
852 852
853/* mps_ap_frame_push -- push a new allocation frame 853/* mps_ap_frame_push -- push a new allocation frame
854 * 854 *
855 * See design.mps.alloc-frame.lw-frame.push. */ 855 * See <design/alloc-frame/#lw-frame.push>. */
856 856
857mps_res_t (mps_ap_frame_push)(mps_frame_t *frame_o, mps_ap_t mps_ap) 857mps_res_t (mps_ap_frame_push)(mps_frame_t *frame_o, mps_ap_t mps_ap)
858{ 858{
@@ -893,7 +893,7 @@ mps_res_t (mps_ap_frame_push)(mps_frame_t *frame_o, mps_ap_t mps_ap)
893 893
894/* mps_ap_frame_pop -- push a new allocation frame 894/* mps_ap_frame_pop -- push a new allocation frame
895 * 895 *
896 * See design.mps.alloc-frame.lw-frame.pop. */ 896 * See <design/alloc-frame/#lw-frame.pop>. */
897 897
898mps_res_t (mps_ap_frame_pop)(mps_ap_t mps_ap, mps_frame_t frame) 898mps_res_t (mps_ap_frame_pop)(mps_ap_t mps_ap, mps_frame_t frame)
899{ 899{
@@ -1402,7 +1402,7 @@ void mps_ld_reset(mps_ld_t mps_ld, mps_arena_t mps_arena)
1402 1402
1403/* mps_ld_add -- add a reference to a location dependency 1403/* mps_ld_add -- add a reference to a location dependency
1404 * 1404 *
1405 * See design.mps.interface.c.lock-free. */ 1405 * See <design/interface-c/#lock-free>. */
1406 1406
1407void mps_ld_add(mps_ld_t mps_ld, mps_arena_t mps_arena, mps_addr_t addr) 1407void mps_ld_add(mps_ld_t mps_ld, mps_arena_t mps_arena, mps_addr_t addr)
1408{ 1408{
@@ -1415,7 +1415,7 @@ void mps_ld_add(mps_ld_t mps_ld, mps_arena_t mps_arena, mps_addr_t addr)
1415 1415
1416/* mps_ld_merge -- merge two location dependencies 1416/* mps_ld_merge -- merge two location dependencies
1417 * 1417 *
1418 * See design.mps.interface.c.lock-free. */ 1418 * See <design/interface-c/#lock-free>. */
1419 1419
1420void mps_ld_merge(mps_ld_t mps_ld, mps_arena_t mps_arena, 1420void mps_ld_merge(mps_ld_t mps_ld, mps_arena_t mps_arena,
1421 mps_ld_t mps_from) 1421 mps_ld_t mps_from)
@@ -1430,7 +1430,7 @@ void mps_ld_merge(mps_ld_t mps_ld, mps_arena_t mps_arena,
1430 1430
1431/* mps_ld_isstale -- check whether a location dependency is "stale" 1431/* mps_ld_isstale -- check whether a location dependency is "stale"
1432 * 1432 *
1433 * See design.mps.interface.c.lock-free. */ 1433 * See <design/interface-c/#lock-free>. */
1434 1434
1435mps_bool_t mps_ld_isstale(mps_ld_t mps_ld, mps_arena_t mps_arena, 1435mps_bool_t mps_ld_isstale(mps_ld_t mps_ld, mps_arena_t mps_arena,
1436 mps_addr_t addr) 1436 mps_addr_t addr)
diff --git a/mps/code/mpsio.h b/mps/code/mpsio.h
index 43dfe096316..db3149dff58 100644
--- a/mps/code/mpsio.h
+++ b/mps/code/mpsio.h
@@ -4,7 +4,7 @@
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .readership: For MPS client application developers, MPS developers. 6 * .readership: For MPS client application developers, MPS developers.
7 * .sources: design.mps.io 7 * .sources: <design/io/>
8 */ 8 */
9 9
10#ifndef mpsio_h 10#ifndef mpsio_h
diff --git a/mps/code/mpsioan.c b/mps/code/mpsioan.c
index 99fd9e95cb7..fd7dea92601 100644
--- a/mps/code/mpsioan.c
+++ b/mps/code/mpsioan.c
@@ -4,7 +4,7 @@
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .readership: For MPS client application developers and MPS developers. 6 * .readership: For MPS client application developers and MPS developers.
7 * .sources: design.mps.io 7 * .sources: <design/io/>
8 */ 8 */
9 9
10#include "mpsio.h" 10#include "mpsio.h"
diff --git a/mps/code/mpslib.h b/mps/code/mpslib.h
index 1c4864bff45..3d4251de2b5 100644
--- a/mps/code/mpslib.h
+++ b/mps/code/mpslib.h
@@ -4,7 +4,7 @@
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .readership: MPS client application developers, MPS developers. 6 * .readership: MPS client application developers, MPS developers.
7 * .sources: design.mps.lib 7 * .sources: <design/lib/>
8 * 8 *
9 * .purpose: The purpose of this file is to declare the functions and types 9 * .purpose: The purpose of this file is to declare the functions and types
10 * required for the MPS library interface. 10 * required for the MPS library interface.
diff --git a/mps/code/mpsliban.c b/mps/code/mpsliban.c
index 6b58c8417b5..4705b70c523 100644
--- a/mps/code/mpsliban.c
+++ b/mps/code/mpsliban.c
@@ -10,7 +10,7 @@
10 * Interface. 10 * Interface.
11 * 11 *
12 * .readership: For MPS client application developers and MPS developers. 12 * .readership: For MPS client application developers and MPS developers.
13 * .sources: design.mps.lib 13 * .sources: <design/lib/>
14 * 14 *
15 * 15 *
16 * TRANSGRESSIONS (rule.impl.trans) 16 * TRANSGRESSIONS (rule.impl.trans)
diff --git a/mps/code/mpsw3.h b/mps/code/mpsw3.h
index 4a11f66e9ea..e7cf8159606 100644
--- a/mps/code/mpsw3.h
+++ b/mps/code/mpsw3.h
@@ -4,7 +4,7 @@
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .readership: customers, MPS developers. 6 * .readership: customers, MPS developers.
7 * .sources: design.mps.interface.c. 7 * .sources: <design/interface-c/>.
8 */ 8 */
9 9
10#ifndef mpsw3_h 10#ifndef mpsw3_h
diff --git a/mps/code/pool.c b/mps/code/pool.c
index bc4c49b774e..0728824743e 100644
--- a/mps/code/pool.c
+++ b/mps/code/pool.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * DESIGN 6 * DESIGN
7 * 7 *
8 * .design: See design.mps.class-interface and design.mps.pool. 8 * .design: See <design/class-interface/> and <design/pool/>.
9 * 9 *
10 * PURPOSE 10 * PURPOSE
11 * 11 *
@@ -99,7 +99,7 @@ Bool PoolCheck(Pool pool)
99/* PoolInit, PoolInitV -- initialize a pool 99/* PoolInit, PoolInitV -- initialize a pool
100 * 100 *
101 * Initialize the generic fields of the pool and calls class-specific 101 * Initialize the generic fields of the pool and calls class-specific
102 * init. See design.mps.pool.align. */ 102 * init. See <design/pool/#align>. */
103 103
104Res PoolInit(Pool pool, Arena arena, PoolClass class, ...) 104Res PoolInit(Pool pool, Arena arena, PoolClass class, ...)
105{ 105{
@@ -130,7 +130,7 @@ Res PoolInitV(Pool pool, Arena arena, PoolClass class, va_list args)
130 /* putting another lock in the code. */ 130 /* putting another lock in the code. */
131 class->labelled = TRUE; 131 class->labelled = TRUE;
132 classId = EventInternString(class->name); 132 classId = EventInternString(class->name);
133 /* @@@@ this breaks design.mps.type.addr.use */ 133 /* @@@@ this breaks <design/type/#addr.use> */
134 EventLabelAddr((Addr)class, classId); 134 EventLabelAddr((Addr)class, classId);
135 } 135 }
136 136
@@ -147,7 +147,7 @@ Res PoolInitV(Pool pool, Arena arena, PoolClass class, va_list args)
147 pool->fillInternalSize = 0.0; 147 pool->fillInternalSize = 0.0;
148 pool->emptyInternalSize = 0.0; 148 pool->emptyInternalSize = 0.0;
149 149
150 /* Initialise signature last; see design.mps.sig */ 150 /* Initialise signature last; see <design/sig/> */
151 pool->sig = PoolSig; 151 pool->sig = PoolSig;
152 pool->serial = globals->poolSerial; 152 pool->serial = globals->poolSerial;
153 ++(globals->poolSerial); 153 ++(globals->poolSerial);
@@ -399,7 +399,7 @@ Res PoolScan(Bool *totalReturn, ScanState ss, Pool pool, Seg seg)
399 399
400/* PoolFix* -- fix a reference to an object in this pool 400/* PoolFix* -- fix a reference to an object in this pool
401 * 401 *
402 * See impl.h.mpm for macro version; see design.mps.pool.req.fix. */ 402 * See impl.h.mpm for macro version; see <design/pool/#req.fix>. */
403 403
404Res (PoolFix)(Pool pool, ScanState ss, Seg seg, Addr *refIO) 404Res (PoolFix)(Pool pool, ScanState ss, Seg seg, Addr *refIO)
405{ 405{
diff --git a/mps/code/poolabs.c b/mps/code/poolabs.c
index f888e9cb885..9269a586e53 100644
--- a/mps/code/poolabs.c
+++ b/mps/code/poolabs.c
@@ -181,7 +181,7 @@ DEFINE_CLASS(AbstractCollectPoolClass, class)
181 181
182/* PoolNo*, PoolTriv* -- Trivial and non-methods for Pool Classes 182/* PoolNo*, PoolTriv* -- Trivial and non-methods for Pool Classes
183 * 183 *
184 * See design.mps.pool.no and design.mps.pool.triv 184 * See <design/pool/#no> and <design/pool/#triv>
185 */ 185 */
186 186
187 187
diff --git a/mps/code/poolamc.c b/mps/code/poolamc.c
index 6a46d1554ec..62aad6f08be 100644
--- a/mps/code/poolamc.c
+++ b/mps/code/poolamc.c
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .sources: design.mps.poolamc. 6 * .sources: <design/poolamc/>.
7 */ 7 */
8 8
9#include "mpscamc.h" 9#include "mpscamc.h"
@@ -76,7 +76,7 @@ typedef struct amcNailboardStruct {
76 * .segtype: AMC segs have a pointer to the type field of either 76 * .segtype: AMC segs have a pointer to the type field of either
77 * a nailboard or a generation. This initial value is passed 77 * a nailboard or a generation. This initial value is passed
78 * as an additional parameter when the segment is allocated. 78 * as an additional parameter when the segment is allocated.
79 * See design.mps.poolamc.fix.nail.distinguish. 79 * See <design/poolamc/#fix.nail.distinguish>.
80 */ 80 */
81 81
82typedef struct amcSegStruct *amcSeg; 82typedef struct amcSegStruct *amcSeg;
@@ -140,7 +140,7 @@ static Res AMCSegInit(Seg seg, Pool pool, Addr base, Size size,
140 140
141/* AMCSegDescribe -- describe the contents of a segment 141/* AMCSegDescribe -- describe the contents of a segment
142 * 142 *
143 * See design.mps.poolamc.seg-describe. 143 * See <design/poolamc/#seg-describe>.
144 */ 144 */
145static Res AMCSegDescribe(Seg seg, mps_lib_FILE *stream) 145static Res AMCSegDescribe(Seg seg, mps_lib_FILE *stream)
146{ 146{
@@ -231,7 +231,7 @@ DEFINE_SEG_CLASS(amcSegClass, class)
231 231
232/* amcSegHasNailboard -- test whether the segment has a nailboard 232/* amcSegHasNailboard -- test whether the segment has a nailboard
233 * 233 *
234 * See design.mps.poolamc.fix.nail.distinguish. 234 * See <design/poolamc/#fix.nail.distinguish>.
235 */ 235 */
236static Bool amcSegHasNailboard(Seg seg) 236static Bool amcSegHasNailboard(Seg seg)
237{ 237{
@@ -272,12 +272,12 @@ static amcGen amcSegGen(Seg seg)
272 272
273/* AMCStruct -- pool AMC descriptor 273/* AMCStruct -- pool AMC descriptor
274 * 274 *
275 * See design.mps.poolamc.struct. 275 * See <design/poolamc/#struct>.
276 */ 276 */
277 277
278#define AMCSig ((Sig)0x519A3C99) /* SIGnature AMC */ 278#define AMCSig ((Sig)0x519A3C99) /* SIGnature AMC */
279 279
280typedef struct AMCStruct { /* design.mps.poolamc.struct */ 280typedef struct AMCStruct { /* <design/poolamc/#struct> */
281 PoolStruct poolStruct; /* generic pool structure */ 281 PoolStruct poolStruct; /* generic pool structure */
282 RankSet rankSet; /* rankSet for entire pool */ 282 RankSet rankSet; /* rankSet for entire pool */
283 RingStruct genRing; /* ring of generations */ 283 RingStruct genRing; /* ring of generations */
@@ -288,9 +288,9 @@ typedef struct AMCStruct { /* design.mps.poolamc.struct */
288 amcGen nursery; /* the default mutator generation */ 288 amcGen nursery; /* the default mutator generation */
289 amcGen rampGen; /* the ramp generation */ 289 amcGen rampGen; /* the ramp generation */
290 amcGen afterRampGen; /* the generation after rampGen */ 290 amcGen afterRampGen; /* the generation after rampGen */
291 unsigned rampCount; /* design.mps.poolamc.ramp.count */ 291 unsigned rampCount; /* <design/poolamc/#ramp.count> */
292 int rampMode; /* design.mps.poolamc.ramp.mode */ 292 int rampMode; /* <design/poolamc/#ramp.mode> */
293 Sig sig; /* design.mps.pool.outer-structure.sig */ 293 Sig sig; /* <design/pool/#outer-structure.sig> */
294} AMCStruct; 294} AMCStruct;
295 295
296#define Pool2AMC(pool) PARENT(AMCStruct, poolStruct, (pool)) 296#define Pool2AMC(pool) PARENT(AMCStruct, poolStruct, (pool))
@@ -348,7 +348,7 @@ typedef struct amcBufStruct *amcBuf;
348typedef struct amcBufStruct { 348typedef struct amcBufStruct {
349 SegBufStruct segbufStruct; /* superclass fields must come first */ 349 SegBufStruct segbufStruct; /* superclass fields must come first */
350 amcGen gen; /* The AMC generation */ 350 amcGen gen; /* The AMC generation */
351 Sig sig; /* design.mps.sig */ 351 Sig sig; /* <design/sig/> */
352} amcBufStruct; 352} amcBufStruct;
353 353
354 354
@@ -419,7 +419,7 @@ static Res AMCBufInit(Buffer buffer, Pool pool, va_list args)
419 /* Set up the buffer to be allocating in the nursery. */ 419 /* Set up the buffer to be allocating in the nursery. */
420 amcbuf->gen = amc->nursery; 420 amcbuf->gen = amc->nursery;
421 } else { 421 } else {
422 amcbuf->gen = NULL; /* no gen yet -- see design.mps.poolamc.forward.gen */ 422 amcbuf->gen = NULL; /* no gen yet -- see <design/poolamc/#forward.gen> */
423 } 423 }
424 amcbuf->sig = amcBufSig; 424 amcbuf->sig = amcBufSig;
425 AVERT(amcBuf, amcbuf); 425 AVERT(amcBuf, amcbuf);
@@ -707,7 +707,7 @@ static Bool amcNailRangeIsMarked(Seg seg, Addr base, Addr limit)
707 707
708/* amcInitComm -- initialize AMC/Z pool 708/* amcInitComm -- initialize AMC/Z pool
709 * 709 *
710 * See design.mps.poolamc.init. 710 * See <design/poolamc/#init>.
711 * Shared by AMCInit and AMCZinit. 711 * Shared by AMCInit and AMCZinit.
712 */ 712 */
713static Res amcInitComm(Pool pool, RankSet rankSet, va_list arg) 713static Res amcInitComm(Pool pool, RankSet rankSet, va_list arg)
@@ -811,7 +811,7 @@ static Res AMCZInit(Pool pool, va_list arg)
811 811
812/* AMCFinish -- finish AMC pool 812/* AMCFinish -- finish AMC pool
813 * 813 *
814 * See design.mps.poolamc.finish. 814 * See <design/poolamc/#finish>.
815 */ 815 */
816static void AMCFinish(Pool pool) 816static void AMCFinish(Pool pool)
817{ 817{
@@ -865,7 +865,7 @@ static void AMCFinish(Pool pool)
865 865
866/* AMCBufferFill -- refill an allocation buffer 866/* AMCBufferFill -- refill an allocation buffer
867 * 867 *
868 * See design.mps.poolamc.fill. 868 * See <design/poolamc/#fill>.
869 */ 869 */
870static Res AMCBufferFill(Addr *baseReturn, Addr *limitReturn, 870static Res AMCBufferFill(Addr *baseReturn, Addr *limitReturn,
871 Pool pool, Buffer buffer, Size size, 871 Pool pool, Buffer buffer, Size size,
@@ -909,7 +909,7 @@ static Res AMCBufferFill(Addr *baseReturn, Addr *limitReturn,
909 if (res != ResOK) 909 if (res != ResOK)
910 return res; 910 return res;
911 911
912 /* design.mps.seg.field.rankSet.start */ 912 /* <design/seg/#field.rankSet.start> */
913 if (BufferRankSet(buffer) == RankSetEMPTY) 913 if (BufferRankSet(buffer) == RankSetEMPTY)
914 SegSetRankAndSummary(seg, BufferRankSet(buffer), RefSetEMPTY); 914 SegSetRankAndSummary(seg, BufferRankSet(buffer), RefSetEMPTY);
915 else 915 else
@@ -939,7 +939,7 @@ static Res AMCBufferFill(Addr *baseReturn, Addr *limitReturn,
939 939
940/* amcBufferEmpty -- detach a buffer from a segment 940/* amcBufferEmpty -- detach a buffer from a segment
941 * 941 *
942 * See design.mps.poolamc.flush. 942 * See <design/poolamc/#flush>.
943 */ 943 */
944static void AMCBufferEmpty(Pool pool, Buffer buffer, Addr init, Addr limit) 944static void AMCBufferEmpty(Pool pool, Buffer buffer, Addr init, Addr limit)
945{ 945{
@@ -960,7 +960,7 @@ static void AMCBufferEmpty(Pool pool, Buffer buffer, Addr init, Addr limit)
960 960
961 arena = BufferArena(buffer); 961 arena = BufferArena(buffer);
962 962
963 /* design.mps.poolamc.flush.pad */ 963 /* <design/poolamc/#flush.pad> */
964 size = AddrOffset(init, limit); 964 size = AddrOffset(init, limit);
965 if (size > 0) { 965 if (size > 0) {
966 ShieldExpose(arena, seg); 966 ShieldExpose(arena, seg);
@@ -1109,7 +1109,7 @@ static Res AMCWhiten(Pool pool, Trace trace, Seg seg)
1109 1109
1110 amc = Pool2AMC(pool); 1110 amc = Pool2AMC(pool);
1111 AVERT(AMC, amc); 1111 AVERT(AMC, amc);
1112 /* see design.mps.poolamc.gen.ramp */ 1112 /* see <design/poolamc/#gen.ramp> */
1113 /* This switching needs to be more complex for multiple traces. */ 1113 /* This switching needs to be more complex for multiple traces. */
1114 AVER(TraceSetIsSingle(PoolArena(pool)->busyTraces)); 1114 AVER(TraceSetIsSingle(PoolArena(pool)->busyTraces));
1115 if (amc->rampMode == beginRamp && gen == amc->rampGen) { 1115 if (amc->rampMode == beginRamp && gen == amc->rampGen) {
@@ -1233,7 +1233,7 @@ static Res amcScanNailed(Bool *totalReturn, ScanState ss, Pool pool,
1233 1233
1234/* AMCScan -- scan a single seg, turning it black 1234/* AMCScan -- scan a single seg, turning it black
1235 * 1235 *
1236 * See design.mps.poolamc.seg-scan. 1236 * See <design/poolamc/#seg-scan>.
1237 */ 1237 */
1238static Res AMCScan(Bool *totalReturn, ScanState ss, Pool pool, Seg seg) 1238static Res AMCScan(Bool *totalReturn, ScanState ss, Pool pool, Seg seg)
1239{ 1239{
@@ -1261,7 +1261,7 @@ static Res AMCScan(Bool *totalReturn, ScanState ss, Pool pool, Seg seg)
1261 EVENT_PPP(AMCScanBegin, amc, seg, ss); 1261 EVENT_PPP(AMCScanBegin, amc, seg, ss);
1262 1262
1263 base = AddrAdd(SegBase(seg), format->headerSize); 1263 base = AddrAdd(SegBase(seg), format->headerSize);
1264 while(SegBuffer(seg) != NULL) { /* design.mps.poolamc.seg-scan.loop */ 1264 while(SegBuffer(seg) != NULL) { /* <design/poolamc/#seg-scan.loop> */
1265 limit = AddrAdd(BufferScanLimit(SegBuffer(seg)), format->headerSize); 1265 limit = AddrAdd(BufferScanLimit(SegBuffer(seg)), format->headerSize);
1266 if (base >= limit) { 1266 if (base >= limit) {
1267 /* @@@@ Are we sure we don't need scan the rest of the segment? */ 1267 /* @@@@ Are we sure we don't need scan the rest of the segment? */
@@ -1278,7 +1278,7 @@ static Res AMCScan(Bool *totalReturn, ScanState ss, Pool pool, Seg seg)
1278 base = limit; 1278 base = limit;
1279 } 1279 }
1280 1280
1281 /* design.mps.poolamc.seg-scan.finish @@@@ base? */ 1281 /* <design/poolamc/#seg-scan.finish> @@@@ base? */
1282 limit = AddrAdd(SegLimit(seg), format->headerSize); 1282 limit = AddrAdd(SegLimit(seg), format->headerSize);
1283 AVER(SegBase(seg) <= base 1283 AVER(SegBase(seg) <= base
1284 && base <= AddrAdd(SegLimit(seg), format->headerSize)); 1284 && base <= AddrAdd(SegLimit(seg), format->headerSize));
@@ -1338,7 +1338,7 @@ static void amcFixInPlace(Pool pool, Seg seg, ScanState ss, Ref *refIO)
1338 1338
1339/* AMCFixEmergency -- fix a reference, without allocating 1339/* AMCFixEmergency -- fix a reference, without allocating
1340 * 1340 *
1341 * See design.mps.poolamc.emergency.fix. 1341 * See <design/poolamc/#emergency.fix>.
1342 */ 1342 */
1343static Res AMCFixEmergency(Pool pool, ScanState ss, Seg seg, Ref *refIO) 1343static Res AMCFixEmergency(Pool pool, ScanState ss, Seg seg, Ref *refIO)
1344{ 1344{
@@ -1371,7 +1371,7 @@ static Res AMCFixEmergency(Pool pool, ScanState ss, Seg seg, Ref *refIO)
1371 return ResOK; 1371 return ResOK;
1372 } 1372 }
1373 1373
1374fixInPlace: /* see design.mps.poolamc.Nailboard.emergency */ 1374fixInPlace: /* see <design/poolamc/>.Nailboard.emergency */
1375 amcFixInPlace(pool, seg, ss, refIO); 1375 amcFixInPlace(pool, seg, ss, refIO);
1376 return ResOK; 1376 return ResOK;
1377} 1377}
@@ -1379,7 +1379,7 @@ fixInPlace: /* see design.mps.poolamc.Nailboard.emergency */
1379 1379
1380/* AMCFix -- fix a reference to the pool 1380/* AMCFix -- fix a reference to the pool
1381 * 1381 *
1382 * See design.mps.poolamc.fix. 1382 * See <design/poolamc/#fix>.
1383 */ 1383 */
1384Res AMCFix(Pool pool, ScanState ss, Seg seg, Ref *refIO) 1384Res AMCFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
1385{ 1385{
@@ -1398,7 +1398,7 @@ Res AMCFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
1398 RefSet toSummary; /* summary of object's destination */ 1398 RefSet toSummary; /* summary of object's destination */
1399 Seg toSeg; /* segment to which object is being relocated */ 1399 Seg toSeg; /* segment to which object is being relocated */
1400 1400
1401 /* design.mps.trace.fix.noaver */ 1401 /* <design/trace/#fix.noaver> */
1402 AVERT_CRITICAL(Pool, pool); 1402 AVERT_CRITICAL(Pool, pool);
1403 AVERT_CRITICAL(ScanState, ss); 1403 AVERT_CRITICAL(ScanState, ss);
1404 AVERT_CRITICAL(Seg, seg); 1404 AVERT_CRITICAL(Seg, seg);
@@ -1496,7 +1496,7 @@ Res AMCFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
1496 if (RefSetDiff(summary, toSummary) != RefSetEMPTY) 1496 if (RefSetDiff(summary, toSummary) != RefSetEMPTY)
1497 SegSetSummary(toSeg, RefSetUnion(toSummary, summary)); 1497 SegSetSummary(toSeg, RefSetUnion(toSummary, summary));
1498 1498
1499 /* design.mps.trace.fix.copy */ 1499 /* <design/trace/#fix.copy> */
1500 (void)AddrCopy(newRef, ref, length); 1500 (void)AddrCopy(newRef, ref, length);
1501 1501
1502 ShieldCover(arena, toSeg); 1502 ShieldCover(arena, toSeg);
@@ -1525,7 +1525,7 @@ returnRes:
1525 1525
1526/* AMCHeaderFix -- fix a reference to the pool, with headers 1526/* AMCHeaderFix -- fix a reference to the pool, with headers
1527 * 1527 *
1528 * See design.mps.poolamc.header.fix. 1528 * See <design/poolamc/#header.fix>.
1529 */ 1529 */
1530static Res AMCHeaderFix(Pool pool, ScanState ss, Seg seg, Ref *refIO) 1530static Res AMCHeaderFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
1531{ 1531{
@@ -1545,7 +1545,7 @@ static Res AMCHeaderFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
1545 RefSet toSummary; /* summary of object's destination */ 1545 RefSet toSummary; /* summary of object's destination */
1546 Seg toSeg; /* segment to which object is being relocated */ 1546 Seg toSeg; /* segment to which object is being relocated */
1547 1547
1548 /* design.mps.trace.fix.noaver */ 1548 /* <design/trace/#fix.noaver> */
1549 AVERT_CRITICAL(Pool, pool); 1549 AVERT_CRITICAL(Pool, pool);
1550 AVERT_CRITICAL(ScanState, ss); 1550 AVERT_CRITICAL(ScanState, ss);
1551 AVERT_CRITICAL(Seg, seg); 1551 AVERT_CRITICAL(Seg, seg);
@@ -1645,7 +1645,7 @@ static Res AMCHeaderFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
1645 if (RefSetDiff(summary, toSummary) != RefSetEMPTY) 1645 if (RefSetDiff(summary, toSummary) != RefSetEMPTY)
1646 SegSetSummary(toSeg, RefSetUnion(toSummary, summary)); 1646 SegSetSummary(toSeg, RefSetUnion(toSummary, summary));
1647 1647
1648 /* design.mps.trace.fix.copy */ 1648 /* <design/trace/#fix.copy> */
1649 (void)AddrCopy(newBase, AddrSub(ref, headerSize), length); 1649 (void)AddrCopy(newBase, AddrSub(ref, headerSize), length);
1650 1650
1651 ShieldCover(arena, toSeg); 1651 ShieldCover(arena, toSeg);
@@ -1701,7 +1701,7 @@ static void amcReclaimNailed(Pool pool, Trace trace, Seg seg)
1701 goto adjustColour; 1701 goto adjustColour;
1702 } 1702 }
1703 1703
1704 /* see design.mps.poolamc.Nailboard.limitations for improvements */ 1704 /* see <design/poolamc/>.Nailboard.limitations for improvements */
1705 headerSize = format->headerSize; 1705 headerSize = format->headerSize;
1706 ShieldExpose(arena, seg); 1706 ShieldExpose(arena, seg);
1707 p = AddrAdd(SegBase(seg), headerSize); 1707 p = AddrAdd(SegBase(seg), headerSize);
@@ -1745,7 +1745,7 @@ adjustColour:
1745 1745
1746/* AMCReclaim -- recycle a segment if it is still white 1746/* AMCReclaim -- recycle a segment if it is still white
1747 * 1747 *
1748 * See design.mps.poolamc.reclaim. 1748 * See <design/poolamc/#reclaim>.
1749 */ 1749 */
1750static void AMCReclaim(Pool pool, Trace trace, Seg seg) 1750static void AMCReclaim(Pool pool, Trace trace, Seg seg)
1751{ 1751{
@@ -1862,7 +1862,7 @@ static void amcWalkAll(Pool pool, FormattedObjectsStepMethod f,
1862 1862
1863/* AMCDescribe -- describe the contents of the AMC pool 1863/* AMCDescribe -- describe the contents of the AMC pool
1864 * 1864 *
1865 * See design.mps.poolamc.describe. 1865 * See <design/poolamc/#describe>.
1866 */ 1866 */
1867static Res AMCDescribe(Pool pool, mps_lib_FILE *stream) 1867static Res AMCDescribe(Pool pool, mps_lib_FILE *stream)
1868{ 1868{
@@ -2015,7 +2015,7 @@ void mps_amc_apply(mps_pool_t mps_pool,
2015 2015
2016/* AMCCheck -- check consistency of the AMC pool 2016/* AMCCheck -- check consistency of the AMC pool
2017 * 2017 *
2018 * See design.mps.poolamc.check. 2018 * See <design/poolamc/#check>.
2019 */ 2019 */
2020static Bool AMCCheck(AMC amc) 2020static Bool AMCCheck(AMC amc)
2021{ 2021{
diff --git a/mps/code/poolams.c b/mps/code/poolams.c
index 4c2d0c33e31..480228c2b14 100644
--- a/mps/code/poolams.c
+++ b/mps/code/poolams.c
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .design: See design.mps.poolams. 6 * .design: See <design/poolams/>.
7 * 7 *
8 * 8 *
9 * TRANSGRESSSIONS 9 * TRANSGRESSSIONS
@@ -41,7 +41,7 @@ Bool AMSSegCheck(AMSSeg amsseg)
41 CHECKL(amsseg->grains >= amsseg->free + amsseg->newAlloc); 41 CHECKL(amsseg->grains >= amsseg->free + amsseg->newAlloc);
42 42
43 if (SegWhite(seg) != TraceSetEMPTY) 43 if (SegWhite(seg) != TraceSetEMPTY)
44 /* design.mps.poolams.colour.single */ 44 /* <design/poolams/#colour.single> */
45 CHECKL(TraceSetIsSingle(SegWhite(seg))); 45 CHECKL(TraceSetIsSingle(SegWhite(seg)));
46 46
47 CHECKL(BoolCheck(amsseg->marksChanged)); 47 CHECKL(BoolCheck(amsseg->marksChanged));
@@ -139,7 +139,7 @@ static Res AMSSegInit(Seg seg, Pool pool, Addr base, Size size,
139 amsseg->grains = size >> ams->grainShift; 139 amsseg->grains = size >> ams->grainShift;
140 amsseg->free = amsseg->grains; 140 amsseg->free = amsseg->grains;
141 amsseg->newAlloc = (Count)0; 141 amsseg->newAlloc = (Count)0;
142 amsseg->marksChanged = FALSE; /* design.mps.poolams.marked.unused */ 142 amsseg->marksChanged = FALSE; /* <design/poolams/#marked.unused> */
143 amsseg->ambiguousFixes = FALSE; 143 amsseg->ambiguousFixes = FALSE;
144 144
145 res = amsCreateTables(&amsseg->allocTable, 145 res = amsCreateTables(&amsseg->allocTable,
@@ -148,7 +148,7 @@ static Res AMSSegInit(Seg seg, Pool pool, Addr base, Size size,
148 if (res != ResOK) 148 if (res != ResOK)
149 goto failCreateTables; 149 goto failCreateTables;
150 150
151 /* start off using firstFree, see design.mps.poolams.no-bit */ 151 /* start off using firstFree, see <design/poolams/#no-bit> */
152 amsseg->allocTableInUse = FALSE; 152 amsseg->allocTableInUse = FALSE;
153 amsseg->firstFree = 0; 153 amsseg->firstFree = 0;
154 amsseg->colourTablesInUse = FALSE; 154 amsseg->colourTablesInUse = FALSE;
@@ -209,15 +209,15 @@ static void AMSSegFinish(Seg seg)
209 * 209 *
210 * .empty: segment merging and splitting is limited to simple cases 210 * .empty: segment merging and splitting is limited to simple cases
211 * where the high segment is empty. 211 * where the high segment is empty.
212 * See design.mps.poolams.split-merge.constrain. 212 * See <design/poolams/#split-merge.constrain>.
213 * 213 *
214 * .grain-align: segment merging and splitting is limited to cases 214 * .grain-align: segment merging and splitting is limited to cases
215 * where the join is aligned with the grain alignment 215 * where the join is aligned with the grain alignment
216 * See design.mps.poolams.split-merge.constrain. 216 * See <design/poolams/#split-merge.constrain>.
217 * 217 *
218 * .alloc-early: Allocations are performed before calling the 218 * .alloc-early: Allocations are performed before calling the
219 * next method to simplify the fail cases. See 219 * next method to simplify the fail cases. See
220 * design.mps.seg.split-merge.fail 220 * <design/seg/#split-merge.fail>
221 * 221 *
222 * .table-names: The names of local variables holding the new 222 * .table-names: The names of local variables holding the new
223 * allocation and colour tables are chosen to have names which 223 * allocation and colour tables are chosen to have names which
@@ -383,10 +383,10 @@ static Res AMSSegSplit(Seg seg, Seg segHi,
383 amsseg->free -= hiGrains; 383 amsseg->free -= hiGrains;
384 amssegHi->free = hiGrains; 384 amssegHi->free = hiGrains;
385 amssegHi->newAlloc = (Count)0; 385 amssegHi->newAlloc = (Count)0;
386 amssegHi->marksChanged = FALSE; /* design.mps.poolams.marked.unused */ 386 amssegHi->marksChanged = FALSE; /* <design/poolams/#marked.unused> */
387 amssegHi->ambiguousFixes = FALSE; 387 amssegHi->ambiguousFixes = FALSE;
388 388
389 /* start off using firstFree, see design.mps.poolams.no-bit */ 389 /* start off using firstFree, see <design/poolams/#no-bit> */
390 amssegHi->allocTableInUse = FALSE; 390 amssegHi->allocTableInUse = FALSE;
391 amssegHi->firstFree = 0; 391 amssegHi->firstFree = 0;
392 /* use colour tables if the segment is white */ 392 /* use colour tables if the segment is white */
@@ -601,7 +601,7 @@ static Res AMSSegCreate(Seg *segReturn, Pool pool, Size size,
601 } 601 }
602 PoolGenUpdateZones(&ams->pgen, seg); 602 PoolGenUpdateZones(&ams->pgen, seg);
603 603
604 /* see design.mps.seg.field.rankset */ 604 /* see <design/seg/#field.rankset> */
605 if (rankSet != RankSetEMPTY) { 605 if (rankSet != RankSetEMPTY) {
606 SegSetRankAndSummary(seg, rankSet, RefSetUNIV); 606 SegSetRankAndSummary(seg, rankSet, RefSetUNIV);
607 } else { 607 } else {
@@ -640,7 +640,7 @@ static Res AMSIterate(Seg seg, AMSObjectFunction f, void *closure);
640/* AMSInit -- the pool class initialization method 640/* AMSInit -- the pool class initialization method
641 * 641 *
642 * Takes one additional argument: the format of the objects 642 * Takes one additional argument: the format of the objects
643 * allocated in the pool. See design.mps.poolams.init. 643 * allocated in the pool. See <design/poolams/#init>.
644 */ 644 */
645static Res AMSInit(Pool pool, va_list args) 645static Res AMSInit(Pool pool, va_list args)
646{ 646{
@@ -777,7 +777,7 @@ static Bool amsSegAlloc(Index *baseReturn, Index *limitReturn,
777/* AMSBufferFill -- the pool class buffer fill method 777/* AMSBufferFill -- the pool class buffer fill method
778 * 778 *
779 * Iterates over the segments looking for space. See 779 * Iterates over the segments looking for space. See
780 * design.mps.poolams.fill. 780 * <design/poolams/#fill>.
781 */ 781 */
782Res AMSBufferFill(Addr *baseReturn, Addr *limitReturn, 782Res AMSBufferFill(Addr *baseReturn, Addr *limitReturn,
783 Pool pool, Buffer buffer, Size size, 783 Pool pool, Buffer buffer, Size size,
@@ -804,12 +804,12 @@ Res AMSBufferFill(Addr *baseReturn, Addr *limitReturn,
804 AVER(BoolCheck(withReservoirPermit)); 804 AVER(BoolCheck(withReservoirPermit));
805 805
806 /* Check that we're not in the grey mutator phase (see */ 806 /* Check that we're not in the grey mutator phase (see */
807 /* design.mps.poolams.fill.colour). */ 807 /* <design/poolams/#fill.colour>). */
808 AVER(PoolArena(pool)->busyTraces == PoolArena(pool)->flippedTraces); 808 AVER(PoolArena(pool)->busyTraces == PoolArena(pool)->flippedTraces);
809 809
810 rankSet = BufferRankSet(buffer); 810 rankSet = BufferRankSet(buffer);
811 ring = (ams->allocRing)(ams, rankSet, size); 811 ring = (ams->allocRing)(ams, rankSet, size);
812 /* design.mps.poolams.fill.slow */ 812 /* <design/poolams/#fill.slow> */
813 RING_FOR(node, ring, nextNode) { 813 RING_FOR(node, ring, nextNode) {
814 AMSSeg amsseg = RING_ELT(AMSSeg, segRing, node); 814 AMSSeg amsseg = RING_ELT(AMSSeg, segRing, node);
815 AVERT_CRITICAL(AMSSeg, amsseg); 815 AVERT_CRITICAL(AMSSeg, amsseg);
@@ -849,7 +849,7 @@ found:
849/* AMSBufferEmpty -- the pool class buffer empty method 849/* AMSBufferEmpty -- the pool class buffer empty method
850 * 850 *
851 * Frees the unused part of the buffer. The colour of the area doesn't 851 * Frees the unused part of the buffer. The colour of the area doesn't
852 * need to be changed. See design.mps.poolams.empty. 852 * need to be changed. See <design/poolams/#empty>.
853 */ 853 */
854void AMSBufferEmpty(Pool pool, Buffer buffer, Addr init, Addr limit) 854void AMSBufferEmpty(Pool pool, Buffer buffer, Addr init, Addr limit)
855{ 855{
@@ -954,13 +954,13 @@ Res AMSWhiten(Pool pool, Trace trace, Seg seg)
954 amsseg = Seg2AMSSeg(seg); 954 amsseg = Seg2AMSSeg(seg);
955 AVERT(AMSSeg, amsseg); 955 AVERT(AMSSeg, amsseg);
956 956
957 /* design.mps.poolams.colour.single */ 957 /* <design/poolams/#colour.single> */
958 AVER(SegWhite(seg) == TraceSetEMPTY); 958 AVER(SegWhite(seg) == TraceSetEMPTY);
959 AVER(!amsseg->colourTablesInUse); 959 AVER(!amsseg->colourTablesInUse);
960 960
961 amsseg->colourTablesInUse = TRUE; 961 amsseg->colourTablesInUse = TRUE;
962 buffer = SegBuffer(seg); 962 buffer = SegBuffer(seg);
963 if (buffer != NULL) { /* design.mps.poolams.condemn.buffer */ 963 if (buffer != NULL) { /* <design/poolams/#condemn.buffer> */
964 Index scanLimitIndex, limitIndex; 964 Index scanLimitIndex, limitIndex;
965 scanLimitIndex = AMS_ADDR_INDEX(seg, BufferScanLimit(buffer)); 965 scanLimitIndex = AMS_ADDR_INDEX(seg, BufferScanLimit(buffer));
966 limitIndex = AMS_ADDR_INDEX(seg, BufferLimit(buffer)); 966 limitIndex = AMS_ADDR_INDEX(seg, BufferLimit(buffer));
@@ -980,7 +980,7 @@ Res AMSWhiten(Pool pool, Trace trace, Seg seg)
980 /* The unused part of the buffer is new allocation by definition. */ 980 /* The unused part of the buffer is new allocation by definition. */
981 ams->pgen.newSize -= AMSGrainsSize(ams, amsseg->newAlloc - uncondemned); 981 ams->pgen.newSize -= AMSGrainsSize(ams, amsseg->newAlloc - uncondemned);
982 amsseg->newAlloc = uncondemned; 982 amsseg->newAlloc = uncondemned;
983 amsseg->marksChanged = FALSE; /* design.mps.poolams.marked.condemn */ 983 amsseg->marksChanged = FALSE; /* <design/poolams/#marked.condemn> */
984 amsseg->ambiguousFixes = FALSE; 984 amsseg->ambiguousFixes = FALSE;
985 985
986 SegSetWhite(seg, TraceSetAdd(SegWhite(seg), trace)); 986 SegSetWhite(seg, TraceSetAdd(SegWhite(seg), trace));
@@ -1109,7 +1109,7 @@ static Res amsScanObject(Seg seg, Index i, Addr p, Addr next, void *clos)
1109 1109
1110/* AMSScan -- the pool class segment scanning method 1110/* AMSScan -- the pool class segment scanning method
1111 * 1111 *
1112 * See design.mps.poolams.scan 1112 * See <design/poolams/#scan>
1113 */ 1113 */
1114Res AMSScan(Bool *totalReturn, ScanState ss, Pool pool, Seg seg) 1114Res AMSScan(Bool *totalReturn, ScanState ss, Pool pool, Seg seg)
1115{ 1115{
@@ -1132,7 +1132,7 @@ Res AMSScan(Bool *totalReturn, ScanState ss, Pool pool, Seg seg)
1132 AVERT(AMSSeg, amsseg); 1132 AVERT(AMSSeg, amsseg);
1133 1133
1134 /* Check that we're not in the grey mutator phase (see */ 1134 /* Check that we're not in the grey mutator phase (see */
1135 /* design.mps.poolams.not-req.grey). */ 1135 /* <design/poolams/#not-req.grey>). */
1136 AVER(TraceSetSub(ss->traces, arena->flippedTraces)); 1136 AVER(TraceSetSub(ss->traces, arena->flippedTraces));
1137 1137
1138 closureStruct.scanAllObjects = 1138 closureStruct.scanAllObjects =
@@ -1153,13 +1153,13 @@ Res AMSScan(Bool *totalReturn, ScanState ss, Pool pool, Seg seg)
1153 format = pool->format; 1153 format = pool->format;
1154 AVERT(Format, format); 1154 AVERT(Format, format);
1155 alignment = PoolAlignment(AMS2Pool(ams)); 1155 alignment = PoolAlignment(AMS2Pool(ams));
1156 do { /* design.mps.poolams.scan.iter */ 1156 do { /* <design/poolams/#scan.iter> */
1157 amsseg->marksChanged = FALSE; /* design.mps.poolams.marked.scan */ 1157 amsseg->marksChanged = FALSE; /* <design/poolams/#marked.scan> */
1158 /* design.mps.poolams.ambiguous.middle */ 1158 /* <design/poolams/#ambiguous.middle> */
1159 if (amsseg->ambiguousFixes) { 1159 if (amsseg->ambiguousFixes) {
1160 res = (ams->iterate)(seg, amsScanObject, &closureStruct); 1160 res = (ams->iterate)(seg, amsScanObject, &closureStruct);
1161 if (res != ResOK) { 1161 if (res != ResOK) {
1162 /* design.mps.poolams.marked.scan.fail */ 1162 /* <design/poolams/#marked.scan.fail> */
1163 amsseg->marksChanged = TRUE; 1163 amsseg->marksChanged = TRUE;
1164 *totalReturn = FALSE; 1164 *totalReturn = FALSE;
1165 return res; 1165 return res;
@@ -1180,7 +1180,7 @@ Res AMSScan(Bool *totalReturn, ScanState ss, Pool pool, Seg seg)
1180 j = AMS_ADDR_INDEX(seg, next); 1180 j = AMS_ADDR_INDEX(seg, next);
1181 res = (*format->scan)(ss, clientP, clientNext); 1181 res = (*format->scan)(ss, clientP, clientNext);
1182 if (res != ResOK) { 1182 if (res != ResOK) {
1183 /* design.mps.poolams.marked.scan.fail */ 1183 /* <design/poolams/#marked.scan.fail> */
1184 amsseg->marksChanged = TRUE; 1184 amsseg->marksChanged = TRUE;
1185 *totalReturn = FALSE; 1185 *totalReturn = FALSE;
1186 return res; 1186 return res;
@@ -1224,7 +1224,7 @@ Res AMSFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
1224 AVER_CRITICAL(amsseg->colourTablesInUse); 1224 AVER_CRITICAL(amsseg->colourTablesInUse);
1225 1225
1226 /* @@@@ We should check that we're not in the grey mutator phase */ 1226 /* @@@@ We should check that we're not in the grey mutator phase */
1227 /* (see design.mps.poolams.not-req.grey), but there's no way of */ 1227 /* (see <design/poolams/#not-req.grey>), but there's no way of */
1228 /* doing that here (this can be called from RootScan, during flip). */ 1228 /* doing that here (this can be called from RootScan, during flip). */
1229 1229
1230 clientRef = *refIO; 1230 clientRef = *refIO;
@@ -1263,7 +1263,7 @@ Res AMSFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
1263 } else { 1263 } else {
1264 ++ss->preservedInPlaceCount; /* Size updated on reclaim */ 1264 ++ss->preservedInPlaceCount; /* Size updated on reclaim */
1265 if (SegRankSet(seg) == RankSetEMPTY && ss->rank != RankAMBIG) { 1265 if (SegRankSet(seg) == RankSetEMPTY && ss->rank != RankAMBIG) {
1266 /* design.mps.poolams.fix.to-black */ 1266 /* <design/poolams/#fix.to-black> */
1267 Addr clientNext, next; 1267 Addr clientNext, next;
1268 1268
1269 ShieldExpose(PoolArena(pool), seg); 1269 ShieldExpose(PoolArena(pool), seg);
@@ -1276,7 +1276,7 @@ Res AMSFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
1276 } else { /* turn it grey */ 1276 } else { /* turn it grey */
1277 AMSWhiteGreyen(seg, i); 1277 AMSWhiteGreyen(seg, i);
1278 SegSetGrey(seg, TraceSetUnion(SegGrey(seg), ss->traces)); 1278 SegSetGrey(seg, TraceSetUnion(SegGrey(seg), ss->traces));
1279 /* mark it for scanning - design.mps.poolams.marked.fix */ 1279 /* mark it for scanning - <design/poolams/#marked.fix> */
1280 amsseg->marksChanged = TRUE; 1280 amsseg->marksChanged = TRUE;
1281 } 1281 }
1282 } 1282 }
diff --git a/mps/code/poolams.h b/mps/code/poolams.h
index 461150543ec..23482b6459b 100644
--- a/mps/code/poolams.h
+++ b/mps/code/poolams.h
@@ -59,7 +59,7 @@ typedef struct AMSStruct {
59 AMSRingFunction allocRing; /* fn to get the ring to allocate from */ 59 AMSRingFunction allocRing; /* fn to get the ring to allocate from */
60 AMSSegsDestroyFunction segsDestroy; 60 AMSSegsDestroyFunction segsDestroy;
61 AMSSegClassFunction segClass;/* fn to get the class for segments */ 61 AMSSegClassFunction segClass;/* fn to get the class for segments */
62 Sig sig; /* design.mps.pool.outer-structure.sig */ 62 Sig sig; /* <design/pool/#outer-structure.sig> */
63} AMSStruct; 63} AMSStruct;
64 64
65 65
@@ -73,7 +73,7 @@ typedef struct AMSSegStruct {
73 Bool allocTableInUse; /* whether we use allocTable */ 73 Bool allocTableInUse; /* whether we use allocTable */
74 Index firstFree; /* 1st free grain, if allocTable is not used */ 74 Index firstFree; /* 1st free grain, if allocTable is not used */
75 BT allocTable; /* set if grain is allocated */ 75 BT allocTable; /* set if grain is allocated */
76 /* design.mps.poolams.colour.single */ 76 /* <design/poolams/#colour.single> */
77 Bool marksChanged; /* has been marked since last scan */ 77 Bool marksChanged; /* has been marked since last scan */
78 Bool ambiguousFixes; /* has been ambiguously marked since last scan */ 78 Bool ambiguousFixes; /* has been ambiguously marked since last scan */
79 Bool colourTablesInUse;/* whether we use the colour tables */ 79 Bool colourTablesInUse;/* whether we use the colour tables */
@@ -93,7 +93,7 @@ typedef struct AMSSegStruct {
93 93
94 94
95/* macros for abstracting index/address computations */ 95/* macros for abstracting index/address computations */
96/* design.mps.poolams.addr-index.slow */ 96/* <design/poolams/#addr-index.slow> */
97 97
98/* only use when size is a multiple of the grain size */ 98/* only use when size is a multiple of the grain size */
99#define AMSGrains(ams, size) ((size) >> (ams)->grainShift) 99#define AMSGrains(ams, size) ((size) >> (ams)->grainShift)
diff --git a/mps/code/poolawl.c b/mps/code/poolawl.c
index b911f6fc0cc..9c8d062d083 100644
--- a/mps/code/poolawl.c
+++ b/mps/code/poolawl.c
@@ -6,7 +6,7 @@
6 * 6 *
7 * DESIGN 7 * DESIGN
8 * 8 *
9 * .design: See design.mps.poolawl. This is Dylan-specific pool. 9 * .design: See <design/poolawl/>. This is Dylan-specific pool.
10 * 10 *
11 * 11 *
12 * ASSUMPTIONS (about when to scan single references on accesses) 12 * ASSUMPTIONS (about when to scan single references on accesses)
@@ -82,7 +82,7 @@ typedef Addr (*FindDependentMethod)(Addr object);
82 82
83/* AWLStruct -- AWL pool structure 83/* AWLStruct -- AWL pool structure
84 * 84 *
85 * See design.mps.poolawl.poolstruct 85 * See <design/poolawl/#poolstruct>
86 */ 86 */
87 87
88typedef struct AWLStruct { 88typedef struct AWLStruct {
@@ -116,7 +116,7 @@ static Bool AWLCheck(AWL awl);
116 116
117#define AWLSegSig ((Sig)0x519A3759) /* SIGnature AWL SeG */ 117#define AWLSegSig ((Sig)0x519A3759) /* SIGnature AWL SeG */
118 118
119/* design.mps.poolawl.seg */ 119/* <design/poolawl/#seg> */
120typedef struct AWLSegStruct { 120typedef struct AWLSegStruct {
121 GCSegStruct gcSegStruct; /* superclass fields must come first */ 121 GCSegStruct gcSegStruct; /* superclass fields must come first */
122 BT mark; 122 BT mark;
@@ -685,7 +685,7 @@ static Res AWLWhiten(Pool pool, Trace trace, Seg seg)
685 buffer = SegBuffer(seg); 685 buffer = SegBuffer(seg);
686 686
687 /* can only whiten for a single trace, */ 687 /* can only whiten for a single trace, */
688 /* see design.mps.poolawl.fun.condemn */ 688 /* see <design/poolawl/#fun.condemn> */
689 AVER(SegWhite(seg) == TraceSetEMPTY); 689 AVER(SegWhite(seg) == TraceSetEMPTY);
690 690
691 if (buffer == NULL) { 691 if (buffer == NULL) {
@@ -812,9 +812,9 @@ static Res awlScanObject(Arena arena, AWL awl, ScanState ss,
812 dependentObject = awl->findDependent(base); 812 dependentObject = awl->findDependent(base);
813 dependent = SegOfAddr(&dependentSeg, arena, dependentObject); 813 dependent = SegOfAddr(&dependentSeg, arena, dependentObject);
814 if (dependent) { 814 if (dependent) {
815 /* design.mps.poolawl.fun.scan.pass.object.dependent.expose */ 815 /* <design/poolawl/#fun.scan.pass.object.dependent.expose> */
816 ShieldExpose(arena, dependentSeg); 816 ShieldExpose(arena, dependentSeg);
817 /* design.mps.poolawl.fun.scan.pass.object.dependent.summary */ 817 /* <design/poolawl/#fun.scan.pass.object.dependent.summary> */
818 SegSetSummary(dependentSeg, RefSetUNIV); 818 SegSetSummary(dependentSeg, RefSetUNIV);
819 } 819 }
820 820
@@ -873,7 +873,7 @@ static Res awlScanSinglePass(Bool *anyScannedReturn,
873 Index i; /* the index into the bit tables corresponding to p */ 873 Index i; /* the index into the bit tables corresponding to p */
874 Addr objectLimit; 874 Addr objectLimit;
875 875
876 /* design.mps.poolawl.fun.scan.pass.buffer */ 876 /* <design/poolawl/#fun.scan.pass.buffer> */
877 if (p == bufferScanLimit) { 877 if (p == bufferScanLimit) {
878 p = BufferLimit(buffer); 878 p = BufferLimit(buffer);
879 continue; 879 continue;
@@ -886,7 +886,7 @@ static Res awlScanSinglePass(Bool *anyScannedReturn,
886 } 886 }
887 hp = AddrAdd(p, format->headerSize); 887 hp = AddrAdd(p, format->headerSize);
888 objectLimit = (format->skip)(hp); 888 objectLimit = (format->skip)(hp);
889 /* design.mps.poolawl.fun.scan.pass.object */ 889 /* <design/poolawl/#fun.scan.pass.object> */
890 if (scanAllObjects 890 if (scanAllObjects
891 || (BTGet(awlseg->mark, i) && !BTGet(awlseg->scanned, i))) { 891 || (BTGet(awlseg->mark, i) && !BTGet(awlseg->scanned, i))) {
892 Res res = awlScanObject(arena, awl, ss, pool->format, 892 Res res = awlScanObject(arena, awl, ss, pool->format,
diff --git a/mps/code/poollo.c b/mps/code/poollo.c
index 9edae934e20..6ef1df6ccf9 100644
--- a/mps/code/poollo.c
+++ b/mps/code/poollo.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * DESIGN 6 * DESIGN
7 * 7 *
8 * .design: See design.mps.poollo. This is a leaf pool class. 8 * .design: See <design/poollo/>. This is a leaf pool class.
9 */ 9 */
10 10
11#include "mpsclo.h" 11#include "mpsclo.h"
diff --git a/mps/code/poolmrg.c b/mps/code/poolmrg.c
index 27ee414a5d9..17c40313af0 100644
--- a/mps/code/poolmrg.c
+++ b/mps/code/poolmrg.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * DESIGN 6 * DESIGN
7 * 7 *
8 * .design: See design.mps.poolmrg. 8 * .design: See <design/poolmrg/>.
9 * 9 *
10 * NOTES 10 * NOTES
11 * 11 *
@@ -17,7 +17,7 @@
17 * 17 *
18 * TRANSGRESSIONS 18 * TRANSGRESSIONS
19 * 19 *
20 * .addr.void-star: Breaks design.mps.type.addr.use all over the place, 20 * .addr.void-star: Breaks <design/type/#addr.use> all over the place,
21 * accessing the segments acquired from SegAlloc with C pointers. It 21 * accessing the segments acquired from SegAlloc with C pointers. It
22 * would not be practical to use ArenaPeek/Poke everywhere. Blocks 22 * would not be practical to use ArenaPeek/Poke everywhere. Blocks
23 * acquired from ControlAlloc must be directly accessible from C, or else 23 * acquired from ControlAlloc must be directly accessible from C, or else
@@ -110,10 +110,10 @@ static void MRGRefPartSetRef(Arena arena, RefPart refPart, Ref ref)
110 110
111typedef struct MRGStruct { 111typedef struct MRGStruct {
112 PoolStruct poolStruct; /* generic pool structure */ 112 PoolStruct poolStruct; /* generic pool structure */
113 RingStruct entryRing; /* design.mps.poolmrg.poolstruct.entry */ 113 RingStruct entryRing; /* <design/poolmrg/#poolstruct.entry> */
114 RingStruct freeRing; /* design.mps.poolmrg.poolstruct.free */ 114 RingStruct freeRing; /* <design/poolmrg/#poolstruct.free> */
115 RingStruct refRing; /* design.mps.poolmrg.poolstruct.refring */ 115 RingStruct refRing; /* <design/poolmrg/#poolstruct.refring> */
116 Size extendBy; /* design.mps.poolmrg.extend */ 116 Size extendBy; /* <design/poolmrg/#extend> */
117 Sig sig; /* impl.h.mps.sig */ 117 Sig sig; /* impl.h.mps.sig */
118} MRGStruct; 118} MRGStruct;
119 119
@@ -144,14 +144,14 @@ typedef struct MRGRefSegStruct *MRGRefSeg;
144 144
145typedef struct MRGLinkSegStruct { 145typedef struct MRGLinkSegStruct {
146 SegStruct segStruct; /* superclass fields must come first */ 146 SegStruct segStruct; /* superclass fields must come first */
147 MRGRefSeg refSeg; /* design.mps.poolmrg.mrgseg.link.refseg */ 147 MRGRefSeg refSeg; /* <design/poolmrg/#mrgseg.link.refseg> */
148 Sig sig; /* impl.h.misc.sig */ 148 Sig sig; /* impl.h.misc.sig */
149} MRGLinkSegStruct; 149} MRGLinkSegStruct;
150 150
151typedef struct MRGRefSegStruct { 151typedef struct MRGRefSegStruct {
152 GCSegStruct gcSegStruct; /* superclass fields must come first */ 152 GCSegStruct gcSegStruct; /* superclass fields must come first */
153 RingStruct mrgRing; /* design.mps.poolmrg.mrgseg.ref.segring */ 153 RingStruct mrgRing; /* <design/poolmrg/#mrgseg.ref.segring> */
154 MRGLinkSeg linkSeg; /* design.mps.poolmrg.mrgseg.ref.linkseg */ 154 MRGLinkSeg linkSeg; /* <design/poolmrg/#mrgseg.ref.linkseg> */
155 Sig sig; /* impl.h.misc.sig */ 155 Sig sig; /* impl.h.misc.sig */
156} MRGRefSegStruct; 156} MRGRefSegStruct;
157 157
@@ -174,7 +174,7 @@ static SegClass MRGRefSegClassGet(void);
174 * 174 *
175 * .link.nullref: During initialization of a link segment the refSeg 175 * .link.nullref: During initialization of a link segment the refSeg
176 * field will be NULL. This will be initialized when the reference 176 * field will be NULL. This will be initialized when the reference
177 * segment is initialized. See design.mps.poolmrg.mrgseg.link.refseg. 177 * segment is initialized. See <design/poolmrg/#mrgseg.link.refseg>.
178 */ 178 */
179static Bool MRGLinkSegCheck(MRGLinkSeg linkseg) 179static Bool MRGLinkSegCheck(MRGLinkSeg linkseg)
180{ 180{
@@ -268,7 +268,7 @@ static Res MRGRefSegInit(Seg seg, Pool pool, Addr base, Size size,
268 if (res != ResOK) 268 if (res != ResOK)
269 return res; 269 return res;
270 270
271 /* design.mps.seg.field.rankset.start, .improve.rank */ 271 /* <design/seg/#field.rankset.start>, .improve.rank */
272 SegSetRankSet(seg, RankSetSingle(RankFINAL)); 272 SegSetRankSet(seg, RankSetSingle(RankFINAL));
273 273
274 RingInit(&refseg->mrgRing); 274 RingInit(&refseg->mrgRing);
@@ -321,7 +321,7 @@ static Count MRGGuardiansPerSeg(MRG mrg)
321} 321}
322 322
323 323
324/* design.mps.poolmrg.guardian.assoc */ 324/* <design/poolmrg/#guardian.assoc> */
325 325
326#define refPartOfIndex(refseg, index) \ 326#define refPartOfIndex(refseg, index) \
327 ((RefPart)SegBase(RefSeg2Seg(refseg)) + (index)) 327 ((RefPart)SegBase(RefSeg2Seg(refseg)) + (index))
@@ -387,7 +387,7 @@ static void MRGGuardianInit(MRG mrg, Link link, RefPart refPart)
387 RingInit(&link->the.linkRing); 387 RingInit(&link->the.linkRing);
388 link->state = MRGGuardianFREE; 388 link->state = MRGGuardianFREE;
389 RingAppend(&mrg->freeRing, &link->the.linkRing); 389 RingAppend(&mrg->freeRing, &link->the.linkRing);
390 /* design.mps.poolmrg.free.overwrite */ 390 /* <design/poolmrg/#free.overwrite> */
391 MRGRefPartSetRef(PoolArena(&mrg->poolStruct), refPart, 0); 391 MRGRefPartSetRef(PoolArena(&mrg->poolStruct), refPart, 0);
392} 392}
393 393
@@ -465,7 +465,7 @@ static MessageClassStruct MRGMessageClassStruct = {
465 MessageNoGCLiveSize, /* GCLiveSize */ 465 MessageNoGCLiveSize, /* GCLiveSize */
466 MessageNoGCCondemnedSize, /* GCCondemnedSize */ 466 MessageNoGCCondemnedSize, /* GCCondemnedSize */
467 MessageNoGCNotCondemnedSize, /* GCNoteCondemnedSize */ 467 MessageNoGCNotCondemnedSize, /* GCNoteCondemnedSize */
468 MessageClassSig /* design.mps.message.class.sig.double */ 468 MessageClassSig /* <design/message/#class.sig.double> */
469}; 469};
470 470
471 471
@@ -682,7 +682,7 @@ static void MRGFinish(Pool pool)
682 682
683 mrg->sig = SigInvalid; 683 mrg->sig = SigInvalid;
684 RingFinish(&mrg->refRing); 684 RingFinish(&mrg->refRing);
685 /* design.mps.poolmrg.trans.no-finish */ 685 /* <design/poolmrg/#trans.no-finish> */
686} 686}
687 687
688 688
@@ -705,7 +705,7 @@ Res MRGRegister(Pool pool, Ref ref)
705 arena = PoolArena(pool); 705 arena = PoolArena(pool);
706 AVERT(Arena, arena); 706 AVERT(Arena, arena);
707 707
708 /* design.mps.poolmrg.alloc.grow */ 708 /* <design/poolmrg/#alloc.grow> */
709 if (RingIsSingle(&mrg->freeRing)) { 709 if (RingIsSingle(&mrg->freeRing)) {
710 /* .refseg.useless: refseg isn't used */ 710 /* .refseg.useless: refseg isn't used */
711 /* @@@@ Should the client be able to use the reservoir for this? */ 711 /* @@@@ Should the client be able to use the reservoir for this? */
@@ -718,12 +718,12 @@ Res MRGRegister(Pool pool, Ref ref)
718 718
719 link = linkOfRing(freeNode); 719 link = linkOfRing(freeNode);
720 AVER(link->state == MRGGuardianFREE); 720 AVER(link->state == MRGGuardianFREE);
721 /* design.mps.poolmrg.alloc.pop */ 721 /* <design/poolmrg/#alloc.pop> */
722 RingRemove(freeNode); 722 RingRemove(freeNode);
723 link->state = MRGGuardianPREFINAL; 723 link->state = MRGGuardianPREFINAL;
724 RingAppend(&mrg->entryRing, freeNode); 724 RingAppend(&mrg->entryRing, freeNode);
725 725
726 /* design.mps.poolmrg.guardian.ref.alloc */ 726 /* <design/poolmrg/#guardian.ref.alloc> */
727 refPart = MRGRefPartOfLink(link, arena); 727 refPart = MRGRefPartOfLink(link, arena);
728 MRGRefPartSetRef(arena, refPart, ref); 728 MRGRefPartSetRef(arena, refPart, ref);
729 729
@@ -752,7 +752,7 @@ static void MRGFree(Pool pool, Addr old, Size size)
752 arena = PoolArena(pool); 752 arena = PoolArena(pool);
753 AVERT(Arena, arena); 753 AVERT(Arena, arena);
754 754
755 /* design.mps.poolmrg.guardian.ref.free */ 755 /* <design/poolmrg/#guardian.ref.free> */
756 link = MRGLinkOfRefPart(refPart, arena); 756 link = MRGLinkOfRefPart(refPart, arena);
757 AVER(link->state == MRGGuardianPOSTFINAL); 757 AVER(link->state == MRGGuardianPOSTFINAL);
758 758
diff --git a/mps/code/poolmv.c b/mps/code/poolmv.c
index 90de155bb12..8a02ce76f5d 100644
--- a/mps/code/poolmv.c
+++ b/mps/code/poolmv.c
@@ -113,7 +113,7 @@ static Bool MVBlockCheck(MVBlock block)
113 113
114typedef struct MVSpanStruct *MVSpan; 114typedef struct MVSpanStruct *MVSpan;
115typedef struct MVSpanStruct { 115typedef struct MVSpanStruct {
116 Sig sig; /* design.mps.sig */ 116 Sig sig; /* <design/sig/> */
117 RingStruct spans; /* all the spans */ 117 RingStruct spans; /* all the spans */
118 MV mv; /* owning MV pool */ 118 MV mv; /* owning MV pool */
119 Tract tract; /* first tract of the span */ 119 Tract tract; /* first tract of the span */
diff --git a/mps/code/poolmv2.c b/mps/code/poolmv2.c
index e9e484c739c..9572504bab0 100644
--- a/mps/code/poolmv2.c
+++ b/mps/code/poolmv2.c
@@ -6,7 +6,7 @@
6 * .purpose: A manual-variable pool designed to take advantage of 6 * .purpose: A manual-variable pool designed to take advantage of
7 * placement according to predicted deathtime. 7 * placement according to predicted deathtime.
8 * 8 *
9 * .design: See design.mps.poolmv2. 9 * .design: See <design/poolmvt/>.
10 */ 10 */
11 11
12#include "mpm.h" 12#include "mpm.h"
@@ -63,20 +63,20 @@ typedef struct MVTStruct
63 CBSStruct cbsStruct; /* The coalescing block structure */ 63 CBSStruct cbsStruct; /* The coalescing block structure */
64 ABQStruct abqStruct; /* The available block queue */ 64 ABQStruct abqStruct; /* The available block queue */
65 SegPrefStruct segPrefStruct; /* The preferences for segments */ 65 SegPrefStruct segPrefStruct; /* The preferences for segments */
66 /* design.mps.poolmvt:arch.parameters */ 66 /* <design/poolmvt/#arch.parameters> */
67 Size minSize; /* Pool parameter */ 67 Size minSize; /* Pool parameter */
68 Size meanSize; /* Pool parameter */ 68 Size meanSize; /* Pool parameter */
69 Size maxSize; /* Pool parameter */ 69 Size maxSize; /* Pool parameter */
70 Count fragLimit; /* Pool parameter */ 70 Count fragLimit; /* Pool parameter */
71 /* design.mps.poolmvt:arch.overview.abq.reuse.size */ 71 /* <design/poolmvt/#arch.overview.abq.reuse.size> */
72 Size reuseSize; /* Size at which blocks are recycled */ 72 Size reuseSize; /* Size at which blocks are recycled */
73 /* design.mps.poolmvt:arch.ap.fill.size */ 73 /* <design/poolmvt/#arch.ap.fill.size> */
74 Size fillSize; /* Size of pool segments */ 74 Size fillSize; /* Size of pool segments */
75 /* design.mps.poolmvt:arch.contingency */ 75 /* <design/poolmvt/#arch.contingency> */
76 Size availLimit; /* Limit on available */ 76 Size availLimit; /* Limit on available */
77 /* design.mps.poolmvt:impl.c.free.merge.segment.overflow */ 77 /* <design/poolmvt/#impl.c.free.merge.segment.overflow> */
78 Bool abqOverflow; /* ABQ dropped some candidates */ 78 Bool abqOverflow; /* ABQ dropped some candidates */
79 /* design.mps.poolmvt:arch.ap.no-fit.* */ 79 /* <design/poolmvt/#arch.ap.no-fit>.* */
80 Bool splinter; /* Saved splinter */ 80 Bool splinter; /* Saved splinter */
81 Seg splinterSeg; /* Saved splinter seg */ 81 Seg splinterSeg; /* Saved splinter seg */
82 Addr splinterBase; /* Saved splinter base */ 82 Addr splinterBase; /* Saved splinter base */
@@ -227,9 +227,9 @@ static Res MVTInit(Pool pool, va_list arg)
227 unless (fragLimit <= 100) 227 unless (fragLimit <= 100)
228 return ResLIMIT; 228 return ResLIMIT;
229 229
230 /* see design.mps.poolmvt:arch.parameters */ 230 /* see <design/poolmvt/#arch.parameters> */
231 fillSize = SizeAlignUp(maxSize, ArenaAlign(arena)); 231 fillSize = SizeAlignUp(maxSize, ArenaAlign(arena));
232 /* see design.mps.poolmvt:arch.fragmentation.internal */ 232 /* see <design/poolmvt/#arch.fragmentation.internal> */
233 reuseSize = 2 * fillSize; 233 reuseSize = 2 * fillSize;
234 abqDepth = (reserveDepth * meanSize + reuseSize - 1) / reuseSize; 234 abqDepth = (reserveDepth * meanSize + reuseSize - 1) / reuseSize;
235 /* keep the abq from being useless */ 235 /* keep the abq from being useless */
@@ -393,7 +393,7 @@ static void MVTFinish(Pool pool)
393 393
394/* MVTBufferFill -- refill an allocation buffer from an MVT pool 394/* MVTBufferFill -- refill an allocation buffer from an MVT pool
395 * 395 *
396 * See design.mps.poolmvt:impl.c.ap.fill 396 * See <design/poolmvt/#impl.c.ap.fill>
397 */ 397 */
398static Res MVTBufferFill(Addr *baseReturn, Addr *limitReturn, 398static Res MVTBufferFill(Addr *baseReturn, Addr *limitReturn,
399 Pool pool, Buffer buffer, Size minSize, 399 Pool pool, Buffer buffer, Size minSize,
@@ -422,7 +422,7 @@ static Res MVTBufferFill(Addr *baseReturn, Addr *limitReturn,
422 fillSize = mvt->fillSize; 422 fillSize = mvt->fillSize;
423 alignedSize = SizeAlignUp(minSize, ArenaAlign(arena)); 423 alignedSize = SizeAlignUp(minSize, ArenaAlign(arena));
424 424
425 /* design.mps.poolmvt:arch.ap.no-fit.oversize */ 425 /* <design/poolmvt/#arch.ap.no-fit.oversize> */
426 /* Allocate oversize blocks exactly, directly from the arena */ 426 /* Allocate oversize blocks exactly, directly from the arena */
427 if (minSize > fillSize) { 427 if (minSize > fillSize) {
428 res = MVTSegAlloc(&seg, mvt, alignedSize, pool, withReservoirPermit); 428 res = MVTSegAlloc(&seg, mvt, alignedSize, pool, withReservoirPermit);
@@ -445,7 +445,7 @@ static Res MVTBufferFill(Addr *baseReturn, Addr *limitReturn,
445 return res; 445 return res;
446 } 446 }
447 447
448 /* design.mps.poolmvt:arch.ap.no-fit.return */ 448 /* <design/poolmvt/#arch.ap.no-fit.return> */
449 /* Use any splinter, if available */ 449 /* Use any splinter, if available */
450 if (mvt->splinter) { 450 if (mvt->splinter) {
451 base = mvt->splinterBase; 451 base = mvt->splinterBase;
@@ -463,7 +463,7 @@ static Res MVTBufferFill(Addr *baseReturn, Addr *limitReturn,
463 res = ABQPeek(MVTABQ(mvt), &block); 463 res = ABQPeek(MVTABQ(mvt), &block);
464 if (res != ResOK) { 464 if (res != ResOK) {
465 METER_ACC(mvt->underflows, minSize); 465 METER_ACC(mvt->underflows, minSize);
466 /* design.mps.poolmvt:arch.contingency.fragmentation-limit */ 466 /* <design/poolmvt/#arch.contingency.fragmentation-limit> */
467 if (mvt->available >= mvt->availLimit) { 467 if (mvt->available >= mvt->availLimit) {
468 METER_ACC(mvt->fragLimitContingencies, minSize); 468 METER_ACC(mvt->fragLimitContingencies, minSize);
469 res = MVTContingencySearch(&block, MVTCBS(mvt), minSize); 469 res = MVTContingencySearch(&block, MVTCBS(mvt), minSize);
@@ -514,7 +514,7 @@ found:
514 } 514 }
515 515
516 /* Attempt to request a block from the arena */ 516 /* Attempt to request a block from the arena */
517 /* see design.mps.poolmvt:impl.c.free.merge.segment */ 517 /* see <design/poolmvt/#impl.c.free.merge.segment> */
518 res = MVTSegAlloc(&seg, mvt, fillSize, pool, withReservoirPermit); 518 res = MVTSegAlloc(&seg, mvt, fillSize, pool, withReservoirPermit);
519 if (res == ResOK) { 519 if (res == ResOK) {
520 base = SegBase(seg); 520 base = SegBase(seg);
@@ -553,7 +553,7 @@ done:
553/* MVTBufferEmpty -- return an unusable portion of a buffer to the MVT 553/* MVTBufferEmpty -- return an unusable portion of a buffer to the MVT
554 * pool 554 * pool
555 * 555 *
556 * See design.mps.poolmvt:impl.c.ap.empty 556 * See <design/poolmvt/#impl.c.ap.empty>
557 */ 557 */
558static void MVTBufferEmpty(Pool pool, Buffer buffer, 558static void MVTBufferEmpty(Pool pool, Buffer buffer,
559 Addr base, Addr limit) 559 Addr base, Addr limit)
@@ -584,7 +584,7 @@ static void MVTBufferEmpty(Pool pool, Buffer buffer,
584 METER_ACC(mvt->poolSize, mvt->size); 584 METER_ACC(mvt->poolSize, mvt->size);
585 METER_ACC(mvt->bufferEmpties, size); 585 METER_ACC(mvt->bufferEmpties, size);
586 586
587 /* design.mps.poolmvt:arch.ap.no-fit.splinter */ 587 /* <design/poolmvt/#arch.ap.no-fit.splinter> */
588 if (size < mvt->minSize) { 588 if (size < mvt->minSize) {
589 res = CBSInsert(MVTCBS(mvt), base, limit); 589 res = CBSInsert(MVTCBS(mvt), base, limit);
590 AVER(res == ResOK); 590 AVER(res == ResOK);
@@ -593,7 +593,7 @@ static void MVTBufferEmpty(Pool pool, Buffer buffer,
593 } 593 }
594 594
595 METER_ACC(mvt->splinters, size); 595 METER_ACC(mvt->splinters, size);
596 /* design.mps.poolmvt:arch.ap.no-fit.return */ 596 /* <design/poolmvt/#arch.ap.no-fit.return> */
597 if (mvt->splinter) { 597 if (mvt->splinter) {
598 Size oldSize = AddrOffset(mvt->splinterBase, mvt->splinterLimit); 598 Size oldSize = AddrOffset(mvt->splinterBase, mvt->splinterLimit);
599 599
@@ -648,7 +648,7 @@ static void MVTFree(Pool pool, Addr base, Size size)
648 METER_ACC(mvt->poolAllocated, mvt->allocated); 648 METER_ACC(mvt->poolAllocated, mvt->allocated);
649 METER_ACC(mvt->poolSize, mvt->size); 649 METER_ACC(mvt->poolSize, mvt->size);
650 650
651 /* design.mps.poolmvt:arch.ap.no-fit.oversize.policy */ 651 /* <design/poolmvt/#arch.ap.no-fit.oversize.policy> */
652 /* Return exceptional blocks directly to arena */ 652 /* Return exceptional blocks directly to arena */
653 if (size > mvt->fillSize) { 653 if (size > mvt->fillSize) {
654 Seg seg; 654 Seg seg;
@@ -862,7 +862,7 @@ static Res MVTSegAlloc(Seg *segReturn, MVT mvt, Size size,
862 if (res == ResOK) { 862 if (res == ResOK) {
863 Size segSize = SegSize(*segReturn); 863 Size segSize = SegSize(*segReturn);
864 864
865 /* see design.mps.poolmvt:arch.fragmentation.internal */ 865 /* see <design/poolmvt/#arch.fragmentation.internal> */
866 AVER(segSize >= mvt->fillSize); 866 AVER(segSize >= mvt->fillSize);
867 mvt->size += segSize; 867 mvt->size += segSize;
868 mvt->available += segSize; 868 mvt->available += segSize;
@@ -943,7 +943,7 @@ static void MVTNoteNew(CBS cbs, CBSBlock block, Size oldSize, Size newSize)
943 UNUSED(newSize); 943 UNUSED(newSize);
944 944
945 res = ABQPush(MVTABQ(mvt), block); 945 res = ABQPush(MVTABQ(mvt), block);
946 /* See design.mps.poolmvt:impl.c.free.merge */ 946 /* See <design/poolmvt/#impl.c.free.merge> */
947 if (res != ResOK) { 947 if (res != ResOK) {
948 Arena arena = PoolArena(MVT2Pool(mvt)); 948 Arena arena = PoolArena(MVT2Pool(mvt));
949 CBSBlock oldBlock; 949 CBSBlock oldBlock;
diff --git a/mps/code/poolmv2.h b/mps/code/poolmv2.h
index a1d7a8d1e13..e62fe9a3a0d 100644
--- a/mps/code/poolmv2.h
+++ b/mps/code/poolmv2.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * .purpose: The implementation of the new manual-variable pool class 6 * .purpose: The implementation of the new manual-variable pool class
7 * 7 *
8 * .design: See design.mps.poolmv2 8 * .design: See <design/poolmvt/>
9 */ 9 */
10 10
11#ifndef poolmv2_h 11#ifndef poolmv2_h
diff --git a/mps/code/poolmvff.c b/mps/code/poolmvff.c
index 820c4bfe1da..f3219dd9b0b 100644
--- a/mps/code/poolmvff.c
+++ b/mps/code/poolmvff.c
@@ -8,7 +8,7 @@
8 * policy. Provision is made to allocate in reverse. This pool 8 * policy. Provision is made to allocate in reverse. This pool
9 * can allocate across segment boundaries. 9 * can allocate across segment boundaries.
10 * 10 *
11 * .design: design.mps.poolmvff 11 * .design: <design/poolmvff/>
12 * 12 *
13 * 13 *
14 * TRANSGRESSIONS 14 * TRANSGRESSIONS
@@ -32,7 +32,7 @@ extern PoolClass PoolClassMVFF(void);
32/* MVFFStruct -- MVFF (Manual Variable First Fit) pool outer structure 32/* MVFFStruct -- MVFF (Manual Variable First Fit) pool outer structure
33 * 33 *
34 * The signature is placed at the end, see 34 * The signature is placed at the end, see
35 * design.mps.pool.outer-structure.sig 35 * <design/pool/#outer-structure.sig>
36 */ 36 */
37 37
38#define MVFFSig ((Sig)0x5193FFF9) /* SIGnature MVFF */ 38#define MVFFSig ((Sig)0x5193FFF9) /* SIGnature MVFF */
@@ -49,7 +49,7 @@ typedef struct MVFFStruct { /* MVFF pool outer structure */
49 CBSStruct cbsStruct; /* free list */ 49 CBSStruct cbsStruct; /* free list */
50 Bool firstFit; /* as opposed to last fit */ 50 Bool firstFit; /* as opposed to last fit */
51 Bool slotHigh; /* prefers high part of large block */ 51 Bool slotHigh; /* prefers high part of large block */
52 Sig sig; /* design.mps.sig */ 52 Sig sig; /* <design/sig/> */
53} MVFFStruct; 53} MVFFStruct;
54 54
55 55
@@ -188,7 +188,7 @@ static Res MVFFAddSeg(Seg *segReturn,
188 AVER(SizeIsAligned(size, PoolAlignment(pool))); 188 AVER(SizeIsAligned(size, PoolAlignment(pool)));
189 189
190 /* Use extendBy unless it's too small (see */ 190 /* Use extendBy unless it's too small (see */
191 /* design.mps.poolmvff.design.seg-size). */ 191 /* <design/poolmvff/#design.seg-size>). */
192 if (size <= mvff->extendBy) 192 if (size <= mvff->extendBy)
193 segSize = mvff->extendBy; 193 segSize = mvff->extendBy;
194 else 194 else
@@ -200,7 +200,7 @@ static Res MVFFAddSeg(Seg *segReturn,
200 withReservoirPermit); 200 withReservoirPermit);
201 if (res != ResOK) { 201 if (res != ResOK) {
202 /* try again for a seg just large enough for object */ 202 /* try again for a seg just large enough for object */
203 /* see design.mps.poolmvff.design.seg-fail */ 203 /* see <design/poolmvff/#design.seg-fail> */
204 segSize = SizeAlignUp(size, align); 204 segSize = SizeAlignUp(size, align);
205 res = SegAlloc(&seg, SegClassGet(), mvff->segPref, segSize, pool, 205 res = SegAlloc(&seg, SegClassGet(), mvff->segPref, segSize, pool,
206 withReservoirPermit); 206 withReservoirPermit);
@@ -420,7 +420,7 @@ static Res MVFFInit(Pool pool, va_list arg)
420 AVERT(Pool, pool); 420 AVERT(Pool, pool);
421 421
422 /* .arg: class-specific additional arguments; see */ 422 /* .arg: class-specific additional arguments; see */
423 /* design.mps.poolmvff.method.init */ 423 /* <design/poolmvff/#method.init> */
424 /* .arg.check: we do the same checks here and in MVFFCheck */ 424 /* .arg.check: we do the same checks here and in MVFFCheck */
425 /* except for arenaHigh, which is stored only in the segPref. */ 425 /* except for arenaHigh, which is stored only in the segPref. */
426 extendBy = va_arg(arg, Size); 426 extendBy = va_arg(arg, Size);
@@ -604,7 +604,7 @@ mps_class_t mps_class_mvff_debug(void)
604} 604}
605 605
606 606
607/* Total free bytes. See design.mps.poolmvff.design.arena-enter */ 607/* Total free bytes. See <design/poolmvff/#design.arena-enter> */
608 608
609size_t mps_mvff_free_size(mps_pool_t mps_pool) 609size_t mps_mvff_free_size(mps_pool_t mps_pool)
610{ 610{
@@ -619,7 +619,7 @@ size_t mps_mvff_free_size(mps_pool_t mps_pool)
619 return (size_t)mvff->free; 619 return (size_t)mvff->free;
620} 620}
621 621
622/* Total owned bytes. See design.mps.poolmvff.design.arena-enter */ 622/* Total owned bytes. See <design/poolmvff/#design.arena-enter> */
623 623
624size_t mps_mvff_size(mps_pool_t mps_pool) 624size_t mps_mvff_size(mps_pool_t mps_pool)
625{ 625{
diff --git a/mps/code/pooln.h b/mps/code/pooln.h
index 57c09b13152..e0cc5490854 100644
--- a/mps/code/pooln.h
+++ b/mps/code/pooln.h
@@ -31,7 +31,7 @@ extern PoolClass PoolClassN(void);
31/* PoolNCheck -- check a pool of class N 31/* PoolNCheck -- check a pool of class N
32 * 32 *
33 * Validates a PoolN object. This function conforms to the validation 33 * Validates a PoolN object. This function conforms to the validation
34 * protocol defined in design.mps.check. 34 * protocol defined in <design/check/>.
35 */ 35 */
36 36
37extern Bool PoolNCheck(PoolN poolN); 37extern Bool PoolNCheck(PoolN poolN);
diff --git a/mps/code/poolsnc.c b/mps/code/poolsnc.c
index 5d3227abe28..0198391ebb7 100644
--- a/mps/code/poolsnc.c
+++ b/mps/code/poolsnc.c
@@ -12,7 +12,7 @@
12 * .lw-frame-state: The pool uses lightweight frames as its only 12 * .lw-frame-state: The pool uses lightweight frames as its only
13 * type of allocation frame. The lightweight frame state is set to 13 * type of allocation frame. The lightweight frame state is set to
14 * Valid whenever a buffer has a segment and Disabled otherwise. 14 * Valid whenever a buffer has a segment and Disabled otherwise.
15 * See design.mps.alloc-frame.lw-frame.states. 15 * See <design/alloc-frame/#lw-frame.states>.
16 * 16 *
17 * .lw-frame-null: The frame marker NULL is used as a special value 17 * .lw-frame-null: The frame marker NULL is used as a special value
18 * to indicate bottom of stack. 18 * to indicate bottom of stack.
@@ -75,7 +75,7 @@ typedef struct SNCBufStruct *SNCBuf;
75typedef struct SNCBufStruct { 75typedef struct SNCBufStruct {
76 SegBufStruct segBufStruct; /* superclass fields must come first */ 76 SegBufStruct segBufStruct; /* superclass fields must come first */
77 Seg topseg; /* The segment chain head -- may be NULL */ 77 Seg topseg; /* The segment chain head -- may be NULL */
78 Sig sig; /* design.mps.sig */ 78 Sig sig; /* <design/sig/> */
79} SNCBufStruct; 79} SNCBufStruct;
80 80
81 81
@@ -443,7 +443,7 @@ static Res SNCBufferFill(Addr *baseReturn, Addr *limitReturn,
443 return res; 443 return res;
444 444
445found: 445found:
446 /* design.mps.seg.field.rankSet.start */ 446 /* <design/seg/#field.rankSet.start> */
447 if (BufferRankSet(buffer) == RankSetEMPTY) 447 if (BufferRankSet(buffer) == RankSetEMPTY)
448 SegSetRankAndSummary(seg, BufferRankSet(buffer), RefSetEMPTY); 448 SegSetRankAndSummary(seg, BufferRankSet(buffer), RefSetEMPTY);
449 else 449 else
diff --git a/mps/code/prmcan.c b/mps/code/prmcan.c
index 9c36baf90d8..86aaa37ee50 100644
--- a/mps/code/prmcan.c
+++ b/mps/code/prmcan.c
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .design: See design.mps.prot for the generic design of the interface 6 * .design: See <design/prot/> for the generic design of the interface
7 * which is implemented in this module including the contracts for the 7 * which is implemented in this module including the contracts for the
8 * functions. 8 * functions.
9 * 9 *
diff --git a/mps/code/protan.c b/mps/code/protan.c
index e6d113a4849..ff02074fe3f 100644
--- a/mps/code/protan.c
+++ b/mps/code/protan.c
@@ -6,7 +6,7 @@
6 * 6 *
7 * DESIGN 7 * DESIGN
8 * 8 *
9 * design.mps.protan 9 * <design/protan/>
10 */ 10 */
11 11
12#include "mpm.h" 12#include "mpm.h"
@@ -36,7 +36,7 @@ void ProtSet(Addr base, Addr limit, AccessSet pm)
36 36
37/* ProtSync -- synchronize protection settings with hardware 37/* ProtSync -- synchronize protection settings with hardware
38 * 38 *
39 * See design.mps.protan.fun.sync. 39 * See <design/protan/#fun.sync>.
40 */ 40 */
41 41
42void ProtSync(Arena arena) 42void ProtSync(Arena arena)
@@ -53,7 +53,7 @@ void ProtSync(Arena arena)
53 Addr base; 53 Addr base;
54 do { 54 do {
55 base = SegBase(seg); 55 base = SegBase(seg);
56 if (SegPM(seg) != AccessSetEMPTY) { /* design.mps.protan.fun.sync.seg */ 56 if (SegPM(seg) != AccessSetEMPTY) { /* <design/protan/#fun.sync.seg> */
57 ShieldEnter(arena); 57 ShieldEnter(arena);
58 TraceSegAccess(arena, seg, SegPM(seg)); 58 TraceSegAccess(arena, seg, SegPM(seg));
59 ShieldLeave(arena); 59 ShieldLeave(arena);
diff --git a/mps/code/proti3.c b/mps/code/proti3.c
index caea8be71a7..72598f170ba 100644
--- a/mps/code/proti3.c
+++ b/mps/code/proti3.c
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .design: See design.mps.prot for the generic design of the interface 6 * .design: See <design/prot/> for the generic design of the interface
7 * which is implemented in this module, including the contracts for the 7 * which is implemented in this module, including the contracts for the
8 * functions. 8 * functions.
9 * 9 *
diff --git a/mps/code/protocol.c b/mps/code/protocol.c
index 4db59cbf9e0..9d8f6cff6d6 100644
--- a/mps/code/protocol.c
+++ b/mps/code/protocol.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * DESIGN 6 * DESIGN
7 * 7 *
8 * .design: See design.mps.protocol 8 * .design: See <design/protocol/>
9 */ 9 */
10 10
11#include "mpm.h" 11#include "mpm.h"
diff --git a/mps/code/protocol.h b/mps/code/protocol.h
index a36b1055a8e..22fa6f21df7 100644
--- a/mps/code/protocol.h
+++ b/mps/code/protocol.h
@@ -25,7 +25,7 @@
25 25
26/* Macro to set the superclass field. This is not intended */ 26/* Macro to set the superclass field. This is not intended */
27/* to be used outside this file. This is a polymorphic macro */ 27/* to be used outside this file. This is a polymorphic macro */
28/* named as a function. See design.mps.protocol.introspect.c-lang */ 28/* named as a function. See <design/protocol/#introspect.c-lang> */
29 29
30#define ProtocolClassSetSuperclassPoly(class, super) \ 30#define ProtocolClassSetSuperclassPoly(class, super) \
31 (((ProtocolClass)(class))->superclass) = (ProtocolClass)(super) 31 (((ProtocolClass)(class))->superclass) = (ProtocolClass)(super)
@@ -120,7 +120,7 @@ typedef Bool (*ProtocolCoerceClassMethod)(ProtocolClass *coerceResult,
120 120
121 121
122typedef struct ProtocolClassStruct { 122typedef struct ProtocolClassStruct {
123 Sig sig; /* design.mps.sig */ 123 Sig sig; /* <design/sig/> */
124 ProtocolClass superclass; /* the superclass */ 124 ProtocolClass superclass; /* the superclass */
125 ProtocolCoerceInstMethod coerceInst; /* coerce instance to super */ 125 ProtocolCoerceInstMethod coerceInst; /* coerce instance to super */
126 ProtocolCoerceClassMethod coerceClass; /* coerce class to superclass */ 126 ProtocolCoerceClassMethod coerceClass; /* coerce class to superclass */
@@ -128,7 +128,7 @@ typedef struct ProtocolClassStruct {
128 128
129 129
130typedef struct ProtocolInstStruct { 130typedef struct ProtocolInstStruct {
131 Sig sig; /* design.mps.sig */ 131 Sig sig; /* <design/sig/> */
132 ProtocolClass class; /* the class */ 132 ProtocolClass class; /* the class */
133} ProtocolInstStruct; 133} ProtocolInstStruct;
134 134
@@ -159,7 +159,7 @@ extern Bool ProtocolIsSubclass(ProtocolClass sub, ProtocolClass super);
159 159
160/* The following are macros because of the need to cast */ 160/* The following are macros because of the need to cast */
161/* subtypes of ProtocolClass. Nevertheless they are named */ 161/* subtypes of ProtocolClass. Nevertheless they are named */
162/* as functions. See design.mps.protocol.introspect.c-lang */ 162/* as functions. See <design/protocol/#introspect.c-lang> */
163 163
164 164
165#define ProtocolClassSuperclassPoly(class) \ 165#define ProtocolClassSuperclassPoly(class) \
@@ -175,7 +175,7 @@ extern Bool ProtocolIsSubclass(ProtocolClass sub, ProtocolClass super);
175 * 175 *
176 * Returns the superclass, with type ProtocolClass. Clients will 176 * Returns the superclass, with type ProtocolClass. Clients will
177 * probably wish to cast this. See 177 * probably wish to cast this. See
178 * design.mps.protocol.int.static-superclass 178 * <design/protocol/#int.static-superclass>
179 */ 179 */
180#define SUPERCLASS(className) \ 180#define SUPERCLASS(className) \
181 ProtocolClassSuperclassPoly(DERIVE_ENSURE(className)()) 181 ProtocolClassSuperclassPoly(DERIVE_ENSURE(className)())
diff --git a/mps/code/protsu.c b/mps/code/protsu.c
index e28f0b1d873..0b02c05b5a2 100644
--- a/mps/code/protsu.c
+++ b/mps/code/protsu.c
@@ -5,8 +5,8 @@
5 * 5 *
6 * DESIGN 6 * DESIGN
7 * 7 *
8 * see design.mps.prot for the generic design (including the interface), 8 * see <design/prot/> for the generic design (including the interface),
9 * and design.mps.protsu for the design specific to this implementation. 9 * and <design/protsu/> for the design specific to this implementation.
10 * 10 *
11 * TRANSGRESSIONS 11 * TRANSGRESSIONS
12 * 12 *
@@ -153,7 +153,7 @@ void ProtSetup(void)
153{ 153{
154 handler_t next; 154 handler_t next;
155 155
156 /* ProtSetup is called exactly once, see design.mps.prot.if.setup */ 156 /* ProtSetup is called exactly once, see <design/prot/#if.setup> */
157 AVER(sigNext == NULL); 157 AVER(sigNext == NULL);
158 158
159 next = signal(SIGSEGV, sigHandle); 159 next = signal(SIGSEGV, sigHandle);
@@ -206,7 +206,7 @@ void ProtSet(Addr base, Addr limit, AccessSet mode)
206 206
207 /* 2nd arg to mprotect, .assume.size */ 207 /* 2nd arg to mprotect, .assume.size */
208 if(mprotect((caddr_t)base, (int)AddrOffset(base, limit), flags) != 0) { 208 if(mprotect((caddr_t)base, (int)AddrOffset(base, limit), flags) != 0) {
209 /* design.mps.protsu.fun.set.assume.mprotect */ 209 /* <design/protsu/#fun.set.assume.mprotect> */
210 NOTREACHED; 210 NOTREACHED;
211 } 211 }
212} 212}
diff --git a/mps/code/pthrdext.c b/mps/code/pthrdext.c
index 5d19a744977..1aa4be26222 100644
--- a/mps/code/pthrdext.c
+++ b/mps/code/pthrdext.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * .purpose: Provides extension to Pthreads. 6 * .purpose: Provides extension to Pthreads.
7 * 7 *
8 * .design: see design.mps.pthreadext 8 * .design: see <design/pthreadext/>
9 * 9 *
10 * .acknowledgements: This was derived from code posted to 10 * .acknowledgements: This was derived from code posted to
11 * comp.programming.threads by Dave Butenhof and Raymond Lau 11 * comp.programming.threads by Dave Butenhof and Raymond Lau
@@ -36,7 +36,7 @@ SRCID(pthreadext, "$Id$");
36 36
37/* PTHREADEXT_SIGSUSPEND, PTHREADEXT_SIGRESUME -- signals used 37/* PTHREADEXT_SIGSUSPEND, PTHREADEXT_SIGRESUME -- signals used
38 * 38 *
39 * See design.mps.pthreadext.impl.signals 39 * See <design/pthreadext/#impl.signals>
40 */ 40 */
41 41
42#define PTHREADEXT_SIGSUSPEND SIGXFSZ 42#define PTHREADEXT_SIGSUSPEND SIGXFSZ
@@ -44,7 +44,7 @@ SRCID(pthreadext, "$Id$");
44 44
45 45
46/* Static data initiatialized on first use of the module 46/* Static data initiatialized on first use of the module
47 * See design.mps.pthreadext.impl.static.* 47 * See <design/pthreadext/#impl.static>.*
48 */ 48 */
49 49
50/* mutex */ 50/* mutex */
@@ -59,7 +59,7 @@ static Bool pthreadextModuleInitialized = FALSE;
59 59
60 60
61/* Global variables protected by the mutex 61/* Global variables protected by the mutex
62 * See design.mps.pthreadext.impl.global.* 62 * See <design/pthreadext/#impl.global>.*
63 */ 63 */
64 64
65static PThreadext suspendingVictim = NULL; /* current victim */ 65static PThreadext suspendingVictim = NULL; /* current victim */
@@ -68,7 +68,7 @@ static RingStruct suspendedRing; /* PThreadext suspend ring */
68 68
69/* suspendSignalHandler -- signal handler called when suspending a thread 69/* suspendSignalHandler -- signal handler called when suspending a thread
70 * 70 *
71 * See design.mps.pthreadext.impl.suspend-handler 71 * See <design/pthreadext/#impl.suspend-handler>
72 * 72 *
73 * The interface for determining the MFC might be platform specific. 73 * The interface for determining the MFC might be platform specific.
74 * 74 *
@@ -140,7 +140,7 @@ static void suspendSignalHandler(int sig,
140 140
141/* resumeSignalHandler -- signal handler called when resuming a thread 141/* resumeSignalHandler -- signal handler called when resuming a thread
142 * 142 *
143 * See design.mps.pthreadext.impl.suspend-handler 143 * See <design/pthreadext/#impl.suspend-handler>
144 */ 144 */
145 145
146static void resumeSignalHandler(int sig) 146static void resumeSignalHandler(int sig)
@@ -152,7 +152,7 @@ static void resumeSignalHandler(int sig)
152 152
153/* PThreadextModuleInit -- Initialize the PThreadext module 153/* PThreadextModuleInit -- Initialize the PThreadext module
154 * 154 *
155 * See design.mps.pthreadext.impl.static.init 155 * See <design/pthreadext/#impl.static.init>
156 * 156 *
157 * Dynamically initialize all state when first used 157 * Dynamically initialize all state when first used
158 * (called by pthread_once). 158 * (called by pthread_once).
@@ -263,7 +263,7 @@ extern void PThreadextInit(PThreadext pthreadext, pthread_t id)
263 263
264/* PThreadextFinish -- Finish a pthreadext 264/* PThreadextFinish -- Finish a pthreadext
265 * 265 *
266 * See design.mps.pthreadext.impl.finish 266 * See <design/pthreadext/#impl.finish>
267 */ 267 */
268 268
269extern void PThreadextFinish(PThreadext pthreadext) 269extern void PThreadextFinish(PThreadext pthreadext)
@@ -297,7 +297,7 @@ extern void PThreadextFinish(PThreadext pthreadext)
297 297
298/* PThreadextSuspend -- suspend a thread 298/* PThreadextSuspend -- suspend a thread
299 * 299 *
300 * See design.mps.pthreadext.impl.suspend 300 * See <design/pthreadext/#impl.suspend>
301 */ 301 */
302 302
303Res PThreadextSuspend(PThreadext target, MutatorFaultContext *contextReturn) 303Res PThreadextSuspend(PThreadext target, MutatorFaultContext *contextReturn)
@@ -359,7 +359,7 @@ unlock:
359 359
360/* PThreadextResume -- resume a suspended thread 360/* PThreadextResume -- resume a suspended thread
361 * 361 *
362 * See design.mps.pthreadext.impl.resume 362 * See <design/pthreadext/#impl.resume>
363 */ 363 */
364 364
365Res PThreadextResume(PThreadext target) 365Res PThreadextResume(PThreadext target)
diff --git a/mps/code/pthrdext.h b/mps/code/pthrdext.h
index c56fde4a08c..70a77a90e07 100644
--- a/mps/code/pthrdext.h
+++ b/mps/code/pthrdext.h
@@ -30,7 +30,7 @@ typedef struct PThreadextStruct *PThreadext;
30 */ 30 */
31 31
32typedef struct PThreadextStruct { 32typedef struct PThreadextStruct {
33 Sig sig; /* design.mps.sig */ 33 Sig sig; /* <design/sig/> */
34 pthread_t id; /* Thread ID */ 34 pthread_t id; /* Thread ID */
35 MutatorFaultContext suspendedMFC; /* context if suspended */ 35 MutatorFaultContext suspendedMFC; /* context if suspended */
36 RingStruct threadRing; /* ring of suspended threads */ 36 RingStruct threadRing; /* ring of suspended threads */
diff --git a/mps/code/reserv.c b/mps/code/reserv.c
index e7864e9ca58..f2888a6db8c 100644
--- a/mps/code/reserv.c
+++ b/mps/code/reserv.c
@@ -14,7 +14,7 @@
14SRCID(reserv, "$Id$"); 14SRCID(reserv, "$Id$");
15 15
16 16
17/* The reservoir pool is defined here. See design.mps.reservoir */ 17/* The reservoir pool is defined here. See <design/reservoir/> */
18 18
19#define Pool2Reservoir(pool) PARENT(ReservoirStruct, poolStruct, pool) 19#define Pool2Reservoir(pool) PARENT(ReservoirStruct, poolStruct, pool)
20 20
@@ -129,7 +129,7 @@ static Bool reservoirIsConsistent(Reservoir reservoir)
129 if (size != reservoir->reservoirSize) 129 if (size != reservoir->reservoirSize)
130 return FALSE; 130 return FALSE;
131 131
132 /* design.mps.reservoir.align */ 132 /* <design/reservoir/#align> */
133 return SizeIsAligned(reservoir->reservoirLimit, alignment) 133 return SizeIsAligned(reservoir->reservoirLimit, alignment)
134 && SizeIsAligned(reservoir->reservoirSize, alignment) 134 && SizeIsAligned(reservoir->reservoirSize, alignment)
135 && (reservoir->reservoirLimit >= reservoir->reservoirSize); 135 && (reservoir->reservoirLimit >= reservoir->reservoirSize);
@@ -332,12 +332,12 @@ void ReservoirSetLimit(Reservoir reservoir, Size size)
332 332
333 if (size > 0) { 333 if (size > 0) {
334 Size wastage; 334 Size wastage;
335 /* design.mps.reservoir.wastage */ 335 /* <design/reservoir/#wastage> */
336 wastage = ArenaAlign(arena) * mutatorBufferCount(ArenaGlobals(arena)); 336 wastage = ArenaAlign(arena) * mutatorBufferCount(ArenaGlobals(arena));
337 /* design.mps.reservoir.align */ 337 /* <design/reservoir/#align> */
338 needed = SizeAlignUp(size, ArenaAlign(arena)) + wastage; 338 needed = SizeAlignUp(size, ArenaAlign(arena)) + wastage;
339 } else { 339 } else {
340 needed = 0; /* design.mps.reservoir.really-empty */ 340 needed = 0; /* <design/reservoir/#really-empty> */
341 } 341 }
342 342
343 AVER(SizeIsAligned(needed, ArenaAlign(arena))); 343 AVER(SizeIsAligned(needed, ArenaAlign(arena)));
@@ -388,7 +388,7 @@ Res ReservoirInit(Reservoir reservoir, Arena arena)
388 reservoir->reservoirSize = (Size)0; 388 reservoir->reservoirSize = (Size)0;
389 reservoir->reserve = NULL; 389 reservoir->reserve = NULL;
390 reservoir->sig = ReservoirSig; 390 reservoir->sig = ReservoirSig;
391 /* initialize the reservoir pool, design.mps.reservoir */ 391 /* initialize the reservoir pool, <design/reservoir/> */
392 res = PoolInit(&reservoir->poolStruct, 392 res = PoolInit(&reservoir->poolStruct,
393 arena, EnsureReservoirPoolClass()); 393 arena, EnsureReservoirPoolClass());
394 if (res == ResOK) { 394 if (res == ResOK) {
diff --git a/mps/code/ring.c b/mps/code/ring.c
index 4e2e08099dd..971384f6970 100644
--- a/mps/code/ring.c
+++ b/mps/code/ring.c
@@ -8,7 +8,7 @@
8 * .purpose: Rings are used to manage potentially unbounded collections 8 * .purpose: Rings are used to manage potentially unbounded collections
9 * of things. 9 * of things.
10 * 10 *
11 * .sources: design.mps.ring, 11 * .sources: <design/ring/>,
12 * item 6 of mail.richard_brooksby.1996-03-25.16-02 12 * item 6 of mail.richard_brooksby.1996-03-25.16-02
13 */ 13 */
14 14
@@ -24,7 +24,7 @@ SRCID(ring, "$Id$");
24 * 24 *
25 * RingCheck performs a consistency check on the ring node. 25 * RingCheck performs a consistency check on the ring node.
26 * RingCheckSingle performs the same check, but also checks that 26 * RingCheckSingle performs the same check, but also checks that
27 * the ring node is a singleton (design.mps.ring.def.singleton). 27 * the ring node is a singleton (<design/ring/#def.singleton>).
28 */ 28 */
29 29
30Bool RingCheck(Ring ring) 30Bool RingCheck(Ring ring)
diff --git a/mps/code/ring.h b/mps/code/ring.h
index ae0f6229241..84cfb74c909 100644
--- a/mps/code/ring.h
+++ b/mps/code/ring.h
@@ -94,11 +94,11 @@ extern void (RingRemove)(Ring old);
94extern Ring (RingNext)(Ring ring); 94extern Ring (RingNext)(Ring ring);
95#define RingNext(ring) ((ring)->next) 95#define RingNext(ring) ((ring)->next)
96 96
97/* .ring.elt: See design.mps.ring.elt */ 97/* .ring.elt: See <design/ring/#elt> */
98#define RING_ELT(type, field, node) \ 98#define RING_ELT(type, field, node) \
99 ((type)((char *)(node) - (size_t)(&((type)0)->field))) 99 ((type)((char *)(node) - (size_t)(&((type)0)->field)))
100 100
101/* .ring.for: See design.mps.ring.for */ 101/* .ring.for: See <design/ring/#for> */
102#define RING_FOR(node, ring, next) \ 102#define RING_FOR(node, ring, next) \
103 for(node = RingNext(ring), next = RingNext(node); \ 103 for(node = RingNext(ring), next = RingNext(node); \
104 node != (ring); \ 104 node != (ring); \
diff --git a/mps/code/root.c b/mps/code/root.c
index 736edc04e19..66cf2795db5 100644
--- a/mps/code/root.c
+++ b/mps/code/root.c
@@ -5,8 +5,8 @@
5 * 5 *
6 * .purpose: This is the implementation of the root datatype. 6 * .purpose: This is the implementation of the root datatype.
7 * 7 *
8 * .design: For design, see design.mps.root and 8 * .design: For design, see <design/root/> and
9 * design.mps.root-interface. */ 9 * <design/root/>-interface. */
10 10
11#include "mpm.h" 11#include "mpm.h"
12 12
@@ -154,7 +154,7 @@ Bool RootCheck(Root root)
154 * RootCreate* set up the appropriate union member, and call the generic 154 * RootCreate* set up the appropriate union member, and call the generic
155 * create function to do the actual creation 155 * create function to do the actual creation
156 * 156 *
157 * See design.mps.root.init for initial value. */ 157 * See <design/root/#init> for initial value. */
158 158
159static Res rootCreate(Root *rootReturn, Arena arena, 159static Res rootCreate(Root *rootReturn, Arena arena,
160 Rank rank, RootMode mode, RootVar type, 160 Rank rank, RootMode mode, RootVar type,
@@ -188,7 +188,7 @@ static Res rootCreate(Root *rootReturn, Arena arena,
188 root->protBase = (Addr)0; 188 root->protBase = (Addr)0;
189 root->protLimit = (Addr)0; 189 root->protLimit = (Addr)0;
190 190
191 /* See design.mps.arena.root-ring */ 191 /* See <design/arena/#root-ring> */
192 RingInit(&root->arenaRing); 192 RingInit(&root->arenaRing);
193 193
194 root->serial = globals->rootSerial; 194 root->serial = globals->rootSerial;
diff --git a/mps/code/seg.c b/mps/code/seg.c
index ca3c1c47b80..60157242c92 100644
--- a/mps/code/seg.c
+++ b/mps/code/seg.c
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .design: The design for this module is design.mps.seg. 6 * .design: The design for this module is <design/seg/>.
7 * 7 *
8 * PURPOSE 8 * PURPOSE
9 * 9 *
@@ -169,7 +169,7 @@ static Res SegInit(Seg seg, Pool pool, Addr base, Size size,
169 seg->sig = SegSig; /* set sig now so tract checks will see it */ 169 seg->sig = SegSig; /* set sig now so tract checks will see it */
170 170
171 TRACT_FOR(tract, addr, arena, base, limit) { 171 TRACT_FOR(tract, addr, arena, base, limit) {
172 AVER(TractCheck(tract)); /* design.mps.check.type.no-sig */ 172 AVER(TractCheck(tract)); /* <design/check/#type.no-sig> */
173 AVER(TractP(tract) == NULL); 173 AVER(TractP(tract) == NULL);
174 AVER(!TractHasSeg(tract)); 174 AVER(!TractHasSeg(tract));
175 AVER(TractPool(tract) == pool); 175 AVER(TractPool(tract) == pool);
@@ -197,7 +197,7 @@ static Res SegInit(Seg seg, Pool pool, Addr base, Size size,
197failInit: 197failInit:
198 RingFinish(SegPoolRing(seg)); 198 RingFinish(SegPoolRing(seg));
199 TRACT_FOR(tract, addr, arena, base, limit) { 199 TRACT_FOR(tract, addr, arena, base, limit) {
200 AVER(TractCheck(tract)); /* design.mps.check.type.no-sig */ 200 AVER(TractCheck(tract)); /* <design/check/#type.no-sig> */
201 TRACT_UNSET_SEG(tract); 201 TRACT_UNSET_SEG(tract);
202 } 202 }
203 seg->sig = SigInvalid; 203 seg->sig = SigInvalid;
@@ -234,7 +234,7 @@ static void SegFinish(Seg seg)
234 base = SegBase(seg); 234 base = SegBase(seg);
235 limit = SegLimit(seg); 235 limit = SegLimit(seg);
236 TRACT_TRACT_FOR(tract, addr, arena, seg->firstTract, limit) { 236 TRACT_TRACT_FOR(tract, addr, arena, seg->firstTract, limit) {
237 AVER(TractCheck(tract)); /* design.mps.check.type.no-sig */ 237 AVER(TractCheck(tract)); /* <design/check/#type.no-sig> */
238 TractSetWhite(tract, TraceSetEMPTY); 238 TractSetWhite(tract, TraceSetEMPTY);
239 TRACT_UNSET_SEG(tract); 239 TRACT_UNSET_SEG(tract);
240 } 240 }
@@ -491,7 +491,7 @@ Bool SegNext(Seg *segReturn, Arena arena, Addr addr)
491 491
492/* SegMerge -- Merge two adjacent segments 492/* SegMerge -- Merge two adjacent segments
493 * 493 *
494 * See design.mps.seg.merge 494 * See <design/seg/#merge>
495 */ 495 */
496 496
497Res SegMerge(Seg *mergedSegReturn, Seg segLo, Seg segHi, 497Res SegMerge(Seg *mergedSegReturn, Seg segLo, Seg segHi,
@@ -516,7 +516,7 @@ Res SegMerge(Seg *mergedSegReturn, Seg segLo, Seg segHi,
516 AVER(BoolCheck(withReservoirPermit)); 516 AVER(BoolCheck(withReservoirPermit));
517 arena = PoolArena(SegPool(segLo)); 517 arena = PoolArena(SegPool(segLo));
518 518
519 ShieldFlush(arena); /* see design.mps.seg.split-merge.shield */ 519 ShieldFlush(arena); /* see <design/seg/#split-merge.shield> */
520 520
521 /* Invoke class-specific methods to do the merge */ 521 /* Invoke class-specific methods to do the merge */
522 va_start(args, withReservoirPermit); 522 va_start(args, withReservoirPermit);
@@ -543,7 +543,7 @@ failMerge:
543/* SegSplit -- Split a segment 543/* SegSplit -- Split a segment
544 * 544 *
545 * The segment is split at the indicated position. 545 * The segment is split at the indicated position.
546 * See design.mps.seg.split 546 * See <design/seg/#split>
547 */ 547 */
548 548
549Res SegSplit(Seg *segLoReturn, Seg *segHiReturn, Seg seg, Addr at, 549Res SegSplit(Seg *segLoReturn, Seg *segHiReturn, Seg seg, Addr at,
@@ -569,7 +569,7 @@ Res SegSplit(Seg *segLoReturn, Seg *segHiReturn, Seg seg, Addr at,
569 AVER(at < limit); 569 AVER(at < limit);
570 AVER(BoolCheck(withReservoirPermit)); 570 AVER(BoolCheck(withReservoirPermit));
571 571
572 ShieldFlush(arena); /* see design.mps.seg.split-merge.shield */ 572 ShieldFlush(arena); /* see <design/seg/#split-merge.shield> */
573 573
574 /* Allocate the new segment object from the control pool */ 574 /* Allocate the new segment object from the control pool */
575 res = ControlAlloc((void **)&segNew, arena, class->size, 575 res = ControlAlloc((void **)&segNew, arena, class->size,
@@ -625,7 +625,7 @@ Bool SegCheck(Seg seg)
625 /* can't assume nailed is subset of white - mightn't be during whiten */ 625 /* can't assume nailed is subset of white - mightn't be during whiten */
626 /* CHECKL(TraceSetSub(seg->nailed, seg->white)); */ 626 /* CHECKL(TraceSetSub(seg->nailed, seg->white)); */
627 CHECKL(TraceSetCheck(seg->grey)); 627 CHECKL(TraceSetCheck(seg->grey));
628 CHECKL(TractCheck(seg->firstTract)); /* design.mps.check.type.no-sig */ 628 CHECKL(TractCheck(seg->firstTract)); /* <design/check/#type.no-sig> */
629 pool = SegPool(seg); 629 pool = SegPool(seg);
630 CHECKU(Pool, pool); 630 CHECKU(Pool, pool);
631 arena = PoolArena(pool); 631 arena = PoolArena(pool);
@@ -640,7 +640,7 @@ Bool SegCheck(Seg seg)
640 Seg trseg; 640 Seg trseg;
641 641
642 UNUSED(trseg); /* @@@@ unused in hot varieties */ 642 UNUSED(trseg); /* @@@@ unused in hot varieties */
643 CHECKL(TractCheck(tract)); /* design.mps.check.type.no-sig */ 643 CHECKL(TractCheck(tract)); /* <design/check/#type.no-sig> */
644 CHECKL(TRACT_SEG(&trseg, tract) && (trseg == seg)); 644 CHECKL(TRACT_SEG(&trseg, tract) && (trseg == seg));
645 CHECKL(TractWhite(tract) == seg->white); 645 CHECKL(TractWhite(tract) == seg->white);
646 CHECKL(TractPool(tract) == pool); 646 CHECKL(TractPool(tract) == pool);
@@ -657,13 +657,13 @@ Bool SegCheck(Seg seg)
657 /* "pm", "sm", and "depth" not checked. See .check.shield. */ 657 /* "pm", "sm", and "depth" not checked. See .check.shield. */
658 CHECKL(RankSetCheck(seg->rankSet)); 658 CHECKL(RankSetCheck(seg->rankSet));
659 if (seg->rankSet == RankSetEMPTY) { 659 if (seg->rankSet == RankSetEMPTY) {
660 /* design.mps.seg.field.rankSet.empty: If there are no refs */ 660 /* <design/seg/#field.rankSet.empty>: If there are no refs */
661 /* in the segment then it cannot contain black or grey refs. */ 661 /* in the segment then it cannot contain black or grey refs. */
662 CHECKL(seg->grey == TraceSetEMPTY); 662 CHECKL(seg->grey == TraceSetEMPTY);
663 CHECKL(seg->sm == AccessSetEMPTY); 663 CHECKL(seg->sm == AccessSetEMPTY);
664 CHECKL(seg->pm == AccessSetEMPTY); 664 CHECKL(seg->pm == AccessSetEMPTY);
665 } else { 665 } else {
666 /* design.mps.seg.field.rankSet.single: The Tracer only permits */ 666 /* <design/seg/#field.rankSet.single>: The Tracer only permits */
667 /* one rank per segment [ref?] so this field is either empty or a */ 667 /* one rank per segment [ref?] so this field is either empty or a */
668 /* singleton. */ 668 /* singleton. */
669 CHECKL(RankSetIsSingle(seg->rankSet)); 669 CHECKL(RankSetIsSingle(seg->rankSet));
@@ -807,7 +807,7 @@ static Res segNoMerge(Seg seg, Seg segHi,
807/* segTrivMerge -- Basic Seg merge method 807/* segTrivMerge -- Basic Seg merge method
808 * 808 *
809 * .similar: Segments must be "sufficiently similar". 809 * .similar: Segments must be "sufficiently similar".
810 * See design.mps.seg.merge.inv.similar 810 * See <design/seg/#merge.inv.similar>
811 */ 811 */
812 812
813static Res segTrivMerge(Seg seg, Seg segHi, 813static Res segTrivMerge(Seg seg, Seg segHi,
@@ -846,14 +846,14 @@ static Res segTrivMerge(Seg seg, Seg segHi,
846 AVER(seg->sm == segHi->sm); 846 AVER(seg->sm == segHi->sm);
847 AVER(seg->depth == segHi->depth); 847 AVER(seg->depth == segHi->depth);
848 /* Neither segment may be exposed, or in the shield cache */ 848 /* Neither segment may be exposed, or in the shield cache */
849 /* See design.mps.seg.split-merge.shield & impl.c.shield.def.depth */ 849 /* See <design/seg/#split-merge.shield> & impl.c.shield.def.depth */
850 AVER(seg->depth == 0); 850 AVER(seg->depth == 0);
851 851
852 /* no need to update fields which match. See .similar */ 852 /* no need to update fields which match. See .similar */
853 853
854 seg->limit = limit; 854 seg->limit = limit;
855 TRACT_FOR(tract, addr, arena, mid, limit) { 855 TRACT_FOR(tract, addr, arena, mid, limit) {
856 AVER(TractCheck(tract)); /* design.mps.check.type.no-sig */ 856 AVER(TractCheck(tract)); /* <design/check/#type.no-sig> */
857 AVER(TractHasSeg(tract)); 857 AVER(TractHasSeg(tract));
858 AVER(segHi == TractP(tract)); 858 AVER(segHi == TractP(tract));
859 AVER(TractPool(tract) == pool); 859 AVER(TractPool(tract) == pool);
@@ -919,7 +919,7 @@ static Res segTrivSplit(Seg seg, Seg segHi,
919 UNUSED(args); 919 UNUSED(args);
920 920
921 /* Segment may not be exposed, or in the shield cache */ 921 /* Segment may not be exposed, or in the shield cache */
922 /* See design.mps.seg.split-merge.shield & impl.c.shield.def.depth */ 922 /* See <design/seg/#split-merge.shield> & impl.c.shield.def.depth */
923 AVER(seg->depth == 0); 923 AVER(seg->depth == 0);
924 924
925 /* Full initialization for segHi. Just modify seg. */ 925 /* Full initialization for segHi. Just modify seg. */
@@ -938,7 +938,7 @@ static Res segTrivSplit(Seg seg, Seg segHi,
938 RingInit(SegPoolRing(segHi)); 938 RingInit(SegPoolRing(segHi));
939 939
940 TRACT_FOR(tract, addr, arena, mid, limit) { 940 TRACT_FOR(tract, addr, arena, mid, limit) {
941 AVER(TractCheck(tract)); /* design.mps.check.type.no-sig */ 941 AVER(TractCheck(tract)); /* <design/check/#type.no-sig> */
942 AVER(TractHasSeg(tract)); 942 AVER(TractHasSeg(tract));
943 AVER(seg == TractP(tract)); 943 AVER(seg == TractP(tract));
944 AVER(TractPool(tract) == pool); 944 AVER(TractPool(tract) == pool);
@@ -1032,7 +1032,7 @@ Bool GCSegCheck(GCSeg gcseg)
1032 1032
1033 if (gcseg->buffer != NULL) { 1033 if (gcseg->buffer != NULL) {
1034 CHECKU(Buffer, gcseg->buffer); 1034 CHECKU(Buffer, gcseg->buffer);
1035 /* design.mps.seg.field.buffer.owner */ 1035 /* <design/seg/#field.buffer.owner> */
1036 CHECKL(BufferPool(gcseg->buffer) == SegPool(seg)); 1036 CHECKL(BufferPool(gcseg->buffer) == SegPool(seg));
1037 CHECKL(BufferRankSet(gcseg->buffer) == SegRankSet(seg)); 1037 CHECKL(BufferRankSet(gcseg->buffer) == SegRankSet(seg));
1038 } 1038 }
@@ -1043,7 +1043,7 @@ Bool GCSegCheck(GCSeg gcseg)
1043 RingIsSingle(&gcseg->greyRing)); 1043 RingIsSingle(&gcseg->greyRing));
1044 1044
1045 if (seg->rankSet == RankSetEMPTY) { 1045 if (seg->rankSet == RankSetEMPTY) {
1046 /* design.mps.seg.field.rankSet.empty */ 1046 /* <design/seg/#field.rankSet.empty> */
1047 CHECKL(gcseg->summary == RefSetEMPTY); 1047 CHECKL(gcseg->summary == RefSetEMPTY);
1048 } 1048 }
1049 1049
@@ -1244,7 +1244,7 @@ static void gcSegSetWhite(Seg seg, TraceSet white)
1244 Seg trseg; 1244 Seg trseg;
1245 1245
1246 UNUSED(trseg); /* @@@@ hack: unused in hot varieties */ 1246 UNUSED(trseg); /* @@@@ hack: unused in hot varieties */
1247 AVER_CRITICAL(TractCheck(tract)); /* design.mps.check.type.no-sig */ 1247 AVER_CRITICAL(TractCheck(tract)); /* <design/check/#type.no-sig> */
1248 AVER_CRITICAL(TRACT_SEG(&trseg, tract) && (trseg == seg)); 1248 AVER_CRITICAL(TRACT_SEG(&trseg, tract) && (trseg == seg));
1249 TractSetWhite(tract, white); 1249 TractSetWhite(tract, white);
1250 } 1250 }
@@ -1406,7 +1406,7 @@ static void gcSegSetBuffer(Seg seg, Buffer buffer)
1406/* gcSegMerge -- GCSeg merge method 1406/* gcSegMerge -- GCSeg merge method
1407 * 1407 *
1408 * .buffer: Can't merge two segments both with buffers. 1408 * .buffer: Can't merge two segments both with buffers.
1409 * See design.mps.seg.merge.inv.buffer. 1409 * See <design/seg/#merge.inv.buffer>.
1410 */ 1410 */
1411 1411
1412static Res gcSegMerge(Seg seg, Seg segHi, 1412static Res gcSegMerge(Seg seg, Seg segHi,
@@ -1450,7 +1450,7 @@ static Res gcSegMerge(Seg seg, Seg segHi,
1450 summary = RefSetUnion(gcseg->summary, gcsegHi->summary); 1450 summary = RefSetUnion(gcseg->summary, gcsegHi->summary);
1451 if (summary != gcseg->summary) { 1451 if (summary != gcseg->summary) {
1452 gcSegSetSummary(seg, summary); 1452 gcSegSetSummary(seg, summary);
1453 /* design.mps.seg.split-merge.shield.re-flush */ 1453 /* <design/seg/#split-merge.shield.re-flush> */
1454 ShieldFlush(PoolArena(SegPool(seg))); 1454 ShieldFlush(PoolArena(SegPool(seg)));
1455 } 1455 }
1456 1456
diff --git a/mps/code/segsmss.c b/mps/code/segsmss.c
index c4084813f6e..df3cca7cdad 100644
--- a/mps/code/segsmss.c
+++ b/mps/code/segsmss.c
@@ -51,7 +51,7 @@ typedef struct AMSTStruct {
51 Count badMerges; /* count of unsuccessful segment merges */ 51 Count badMerges; /* count of unsuccessful segment merges */
52 Count bsplits; /* count of buffered segment splits */ 52 Count bsplits; /* count of buffered segment splits */
53 Count bmerges; /* count of buffered segment merges */ 53 Count bmerges; /* count of buffered segment merges */
54 Sig sig; /* design.mps.pool.outer-structure.sig */ 54 Sig sig; /* <design/pool/#outer-structure.sig> */
55} AMSTStruct; 55} AMSTStruct;
56 56
57typedef struct AMSTStruct *AMST; 57typedef struct AMSTStruct *AMST;
@@ -92,7 +92,7 @@ typedef struct AMSTSegStruct {
92 AMSSegStruct amsSegStruct; /* superclass fields must come first */ 92 AMSSegStruct amsSegStruct; /* superclass fields must come first */
93 AMSTSeg next; /* mergeable next segment, or NULL */ 93 AMSTSeg next; /* mergeable next segment, or NULL */
94 AMSTSeg prev; /* mergeable prev segment, or NULL */ 94 AMSTSeg prev; /* mergeable prev segment, or NULL */
95 Sig sig; /* design.mps.pool.outer-structure.sig */ 95 Sig sig; /* <design/pool/#outer-structure.sig> */
96} AMSTSegStruct; 96} AMSTSegStruct;
97 97
98 98
@@ -173,7 +173,7 @@ static void amstSegFinish(Seg seg)
173 * .fail: Test proper handling of the most complex failure cases 173 * .fail: Test proper handling of the most complex failure cases
174 * by deliberately detecting failure sometimes after calling the 174 * by deliberately detecting failure sometimes after calling the
175 * next method. We handle the error by calling the anti-method. 175 * next method. We handle the error by calling the anti-method.
176 * This isn't strictly safe (see design.mps.poolams.split-merge.fail). 176 * This isn't strictly safe (see <design/poolams/#split-merge.fail>).
177 * But we assume here that we won't run out of memory when calling the 177 * But we assume here that we won't run out of memory when calling the
178 * anti-method. 178 * anti-method.
179 */ 179 */
diff --git a/mps/code/shield.c b/mps/code/shield.c
index d7727fec847..69f8e99929d 100644
--- a/mps/code/shield.c
+++ b/mps/code/shield.c
@@ -101,7 +101,7 @@ void (ShieldResume)(Arena arena)
101/* This ensures actual prot mode does not include mode */ 101/* This ensures actual prot mode does not include mode */
102static void protLower(Arena arena, Seg seg, AccessSet mode) 102static void protLower(Arena arena, Seg seg, AccessSet mode)
103{ 103{
104 /* design.mps.trace.fix.noaver */ 104 /* <design/trace/#fix.noaver> */
105 AVERT_CRITICAL(Arena, arena); 105 AVERT_CRITICAL(Arena, arena);
106 UNUSED(arena); 106 UNUSED(arena);
107 AVERT_CRITICAL(Seg, seg); 107 AVERT_CRITICAL(Seg, seg);
@@ -153,7 +153,7 @@ static void flush(Arena arena, Size i)
153 */ 153 */
154static void cache(Arena arena, Seg seg) 154static void cache(Arena arena, Seg seg)
155{ 155{
156 /* design.mps.trace.fix.noaver */ 156 /* <design/trace/#fix.noaver> */
157 AVERT_CRITICAL(Arena, arena); 157 AVERT_CRITICAL(Arena, arena);
158 AVERT_CRITICAL(Seg, seg); 158 AVERT_CRITICAL(Seg, seg);
159 159
@@ -271,13 +271,13 @@ void (ShieldLeave)(Arena arena)
271void (ShieldExpose)(Arena arena, Seg seg) 271void (ShieldExpose)(Arena arena, Seg seg)
272{ 272{
273 AccessSet mode = AccessREAD | AccessWRITE; 273 AccessSet mode = AccessREAD | AccessWRITE;
274 /* design.mps.trace.fix.noaver */ 274 /* <design/trace/#fix.noaver> */
275 AVERT_CRITICAL(Arena, arena); 275 AVERT_CRITICAL(Arena, arena);
276 AVER_CRITICAL(arena->insideShield); 276 AVER_CRITICAL(arena->insideShield);
277 277
278 SegSetDepth(seg, SegDepth(seg) + 1); 278 SegSetDepth(seg, SegDepth(seg) + 1);
279 ++arena->shDepth; 279 ++arena->shDepth;
280 /* design.mps.trace.fix.noaver */ 280 /* <design/trace/#fix.noaver> */
281 AVER_CRITICAL(arena->shDepth > 0); 281 AVER_CRITICAL(arena->shDepth > 0);
282 AVER_CRITICAL(SegDepth(seg) > 0); 282 AVER_CRITICAL(SegDepth(seg) > 0);
283 if (SegPM(seg) & mode) 283 if (SegPM(seg) & mode)
@@ -290,7 +290,7 @@ void (ShieldExpose)(Arena arena, Seg seg)
290 290
291void (ShieldCover)(Arena arena, Seg seg) 291void (ShieldCover)(Arena arena, Seg seg)
292{ 292{
293 /* design.mps.trace.fix.noaver */ 293 /* <design/trace/#fix.noaver> */
294 AVERT_CRITICAL(Arena, arena); 294 AVERT_CRITICAL(Arena, arena);
295 AVERT_CRITICAL(Seg, seg); 295 AVERT_CRITICAL(Seg, seg);
296 AVER_CRITICAL(SegPM(seg) == AccessSetEMPTY); 296 AVER_CRITICAL(SegPM(seg) == AccessSetEMPTY);
diff --git a/mps/code/splay.c b/mps/code/splay.c
index fda71e8bd69..6e4beebc998 100644
--- a/mps/code/splay.c
+++ b/mps/code/splay.c
@@ -6,7 +6,7 @@
6 * .purpose: Splay trees are used to manage potentially unbounded 6 * .purpose: Splay trees are used to manage potentially unbounded
7 * collections of ordered things. 7 * collections of ordered things.
8 * 8 *
9 * .source: design.mps.splay 9 * .source: <design/splay/>
10 * 10 *
11 * .note.stack: It's important that the MPS have a bounded stack 11 * .note.stack: It's important that the MPS have a bounded stack
12 * size, and this is a problem for tree algorithms. Basically, 12 * size, and this is a problem for tree algorithms. Basically,
@@ -108,7 +108,7 @@ static void SplayNodeUpdate(SplayTree tree, SplayNode node)
108 * Link the current top node into the left child of the right tree, 108 * Link the current top node into the left child of the right tree,
109 * leaving the top node as the left child of the old top node. 109 * leaving the top node as the left child of the old top node.
110 * 110 *
111 * See design.mps.splay.impl.link.right. 111 * See <design/splay/#impl.link.right>.
112 */ 112 */
113 113
114static void SplayLinkRight(SplayNode *topIO, SplayNode *rightIO) 114static void SplayLinkRight(SplayNode *topIO, SplayNode *rightIO)
@@ -135,7 +135,7 @@ static void SplayLinkRight(SplayNode *topIO, SplayNode *rightIO)
135 * Link the current top node into the right child of the left tree, 135 * Link the current top node into the right child of the left tree,
136 * leaving the top node as the right child of the old top node. 136 * leaving the top node as the right child of the old top node.
137 * 137 *
138 * See design.mps.splay.impl.link.left. 138 * See <design/splay/#impl.link.left>.
139 */ 139 */
140 140
141static void SplayLinkLeft(SplayNode *topIO, SplayNode *leftIO) { 141static void SplayLinkLeft(SplayNode *topIO, SplayNode *leftIO) {
@@ -161,7 +161,7 @@ static void SplayLinkLeft(SplayNode *topIO, SplayNode *leftIO) {
161 * Rotates node, right child of node, and left child of right 161 * Rotates node, right child of node, and left child of right
162 * child of node, leftwards in the order stated. 162 * child of node, leftwards in the order stated.
163 * 163 *
164 * See design.mps.splay.impl.rotate.left. 164 * See <design/splay/#impl.rotate.left>.
165 */ 165 */
166 166
167static void SplayRotateLeft(SplayNode *nodeIO, SplayTree tree) { 167static void SplayRotateLeft(SplayNode *nodeIO, SplayTree tree) {
@@ -192,7 +192,7 @@ static void SplayRotateLeft(SplayNode *nodeIO, SplayTree tree) {
192 * Rotates node, left child of node, and right child of left 192 * Rotates node, left child of node, and right child of left
193 * child of node, leftwards in the order stated. 193 * child of node, leftwards in the order stated.
194 * 194 *
195 * See design.mps.splay.impl.rotate.right. 195 * See <design/splay/#impl.rotate.right>.
196 */ 196 */
197 197
198static void SplayRotateRight(SplayNode *nodeIO, SplayTree tree) { 198static void SplayRotateRight(SplayNode *nodeIO, SplayTree tree) {
@@ -228,7 +228,7 @@ static void SplayRotateRight(SplayNode *nodeIO, SplayTree tree) {
228 * left and right trees and their last and first nodes respectively 228 * left and right trees and their last and first nodes respectively
229 * will have out of date client properties. 229 * will have out of date client properties.
230 * 230 *
231 * See design.mps.splay.impl.assemble. 231 * See <design/splay/#impl.assemble>.
232 */ 232 */
233 233
234static void SplayAssemble(SplayTree tree, SplayNode top, 234static void SplayAssemble(SplayTree tree, SplayNode top,
@@ -317,7 +317,7 @@ static void SplayAssemble(SplayTree tree, SplayNode top,
317 * Returns whether key was found. This is the real logic behind 317 * Returns whether key was found. This is the real logic behind
318 * splay trees. 318 * splay trees.
319 * 319 *
320 * See design.mps.splay.impl.splay. 320 * See <design/splay/#impl.splay>.
321 */ 321 */
322 322
323static Bool SplaySplay(SplayNode *nodeReturn, SplayTree tree, 323static Bool SplaySplay(SplayNode *nodeReturn, SplayTree tree,
@@ -464,8 +464,8 @@ assemble:
464 464
465/* SplayTreeInsert -- Insert a node into a splay tree 465/* SplayTreeInsert -- Insert a node into a splay tree
466 * 466 *
467 * See design.mps.splay.function.splay.tree.insert and 467 * See <design/splay/#function.splay.tree.insert> and
468 * design.mps.splay.impl.insert. 468 * <design/splay/#impl.insert>.
469 */ 469 */
470 470
471Res SplayTreeInsert(SplayTree tree, SplayNode node, void *key) { 471Res SplayTreeInsert(SplayTree tree, SplayNode node, void *key) {
@@ -516,8 +516,8 @@ Res SplayTreeInsert(SplayTree tree, SplayNode node, void *key) {
516 516
517/* SplayTreeDelete -- Delete a node from a splay tree 517/* SplayTreeDelete -- Delete a node from a splay tree
518 * 518 *
519 * See design.mps.splay.function.splay.tree.delete and 519 * See <design/splay/#function.splay.tree.delete> and
520 * design.mps.splay.impl.delete. 520 * <design/splay/#impl.delete>.
521 */ 521 */
522 522
523Res SplayTreeDelete(SplayTree tree, SplayNode node, void *key) { 523Res SplayTreeDelete(SplayTree tree, SplayNode node, void *key) {
@@ -558,8 +558,8 @@ Res SplayTreeDelete(SplayTree tree, SplayNode node, void *key) {
558 558
559/* SplayTreeSearch -- Search for a node in a splay tree matching a key 559/* SplayTreeSearch -- Search for a node in a splay tree matching a key
560 * 560 *
561 * See design.mps.splay.function.splay.tree.search and 561 * See <design/splay/#function.splay.tree.search> and
562 * design.mps.splay.impl.search. 562 * <design/splay/#impl.search>.
563 */ 563 */
564 564
565 565
@@ -657,8 +657,8 @@ static SplayNode SplayTreeSuccessor(SplayTree tree, void *key) {
657 * 657 *
658 * Search for the two nodes in a splay tree neighbouring a key. 658 * Search for the two nodes in a splay tree neighbouring a key.
659 * 659 *
660 * See design.mps.splay.function.splay.tree.neighbours and 660 * See <design/splay/#function.splay.tree.neighbours> and
661 * design.mps.splay.impl.neighbours. 661 * <design/splay/#impl.neighbours>.
662 */ 662 */
663 663
664 664
@@ -702,12 +702,12 @@ Res SplayTreeNeighbours(SplayNode *leftReturn, SplayNode *rightReturn,
702 * SplayTreeFirst receives a key that must precede all 702 * SplayTreeFirst receives a key that must precede all
703 * nodes in the tree. It returns NULL if the tree is empty. 703 * nodes in the tree. It returns NULL if the tree is empty.
704 * Otherwise, it splays the tree to the first node, and returns the 704 * Otherwise, it splays the tree to the first node, and returns the
705 * new root. See design.mps.splay.function.splay.tree.first. 705 * new root. See <design/splay/#function.splay.tree.first>.
706 * 706 *
707 * SplayTreeNext takes a tree and splays it to the successor of the 707 * SplayTreeNext takes a tree and splays it to the successor of the
708 * old root, and returns the new root. Returns NULL is there are 708 * old root, and returns the new root. Returns NULL is there are
709 * no successors. It takes a key for the old root. See 709 * no successors. It takes a key for the old root. See
710 * design.mps.splay.function.splay.tree.next. 710 * <design/splay/#function.splay.tree.next>.
711 */ 711 */
712 712
713SplayNode SplayTreeFirst(SplayTree tree, void *zeroKey) { 713SplayNode SplayTreeFirst(SplayTree tree, void *zeroKey) {
@@ -990,7 +990,7 @@ void SplayNodeRefresh(SplayTree tree, SplayNode node, void *key)
990 990
991/* SplayTreeDescribe -- Describe a splay tree 991/* SplayTreeDescribe -- Describe a splay tree
992 * 992 *
993 * See design.mps.splay.function.splay.tree.describe. 993 * See <design/splay/#function.splay.tree.describe>.
994 */ 994 */
995 995
996Res SplayTreeDescribe(SplayTree tree, mps_lib_FILE *stream, 996Res SplayTreeDescribe(SplayTree tree, mps_lib_FILE *stream,
diff --git a/mps/code/splay.h b/mps/code/splay.h
index 34f46e7b008..5a3060b1d8a 100644
--- a/mps/code/splay.h
+++ b/mps/code/splay.h
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .source: design.mps.splay 6 * .source: <design/splay/>
7 */ 7 */
8 8
9#ifndef splay_h 9#ifndef splay_h
diff --git a/mps/code/sso1al.s b/mps/code/sso1al.s
index b55b387e315..3b592bb741d 100644
--- a/mps/code/sso1al.s
+++ b/mps/code/sso1al.s
@@ -6,7 +6,7 @@
6 # .readership: Any MPS developer that is prepared to read Alpha 6 # .readership: Any MPS developer that is prepared to read Alpha
7 # assembly code in DIGITAL UNIX 'as' syntax. 7 # assembly code in DIGITAL UNIX 'as' syntax.
8 # 8 #
9 # See design.mps.sso1al for the design (exists). 9 # See <design/sso1al/> for the design (exists).
10 10
11 11
12.globl StackScan 12.globl StackScan
diff --git a/mps/code/than.c b/mps/code/than.c
index 1fb39eb1195..85753d9e6b2 100644
--- a/mps/code/than.c
+++ b/mps/code/than.c
@@ -18,7 +18,7 @@ SRCID(than, "$Id$");
18 18
19 19
20typedef struct ThreadStruct { /* ANSI fake thread structure */ 20typedef struct ThreadStruct { /* ANSI fake thread structure */
21 Sig sig; /* design.mps.sig */ 21 Sig sig; /* <design/sig/> */
22 Serial serial; /* from arena->threadSerial */ 22 Serial serial; /* from arena->threadSerial */
23 Arena arena; /* owning arena */ 23 Arena arena; /* owning arena */
24 RingStruct arenaRing; /* attaches to arena */ 24 RingStruct arenaRing; /* attaches to arena */
@@ -112,7 +112,7 @@ Thread ThreadRingThread(Ring threadRing)
112} 112}
113 113
114 114
115/* Must be thread-safe. See design.mps.interface.c.thread-safety. */ 115/* Must be thread-safe. See <design/interface-c/#thread-safety>. */
116Arena ThreadArena(Thread thread) 116Arena ThreadArena(Thread thread)
117{ 117{
118 /* Can't AVER thread as that would not be thread-safe */ 118 /* Can't AVER thread as that would not be thread-safe */
diff --git a/mps/code/thfri4.c b/mps/code/thfri4.c
index 1276ee9d667..163b58c1450 100644
--- a/mps/code/thfri4.c
+++ b/mps/code/thfri4.c
@@ -52,7 +52,7 @@ SRCID(thfri4, "$Id$");
52/* ThreadStruct -- thread desriptor */ 52/* ThreadStruct -- thread desriptor */
53 53
54typedef struct ThreadStruct { /* PThreads thread structure */ 54typedef struct ThreadStruct { /* PThreads thread structure */
55 Sig sig; /* design.mps.sig */ 55 Sig sig; /* <design/sig/> */
56 Serial serial; /* from arena->threadSerial */ 56 Serial serial; /* from arena->threadSerial */
57 Arena arena; /* owning arena */ 57 Arena arena; /* owning arena */
58 RingStruct arenaRing; /* threads attached to arena */ 58 RingStruct arenaRing; /* threads attached to arena */
@@ -218,7 +218,7 @@ Thread ThreadRingThread(Ring threadRing)
218 218
219/* ThreadArena -- get the arena of a thread 219/* ThreadArena -- get the arena of a thread
220 * 220 *
221 * Must be thread-safe. See design.mps.interface.c.thread-safety. 221 * Must be thread-safe. See <design/interface-c/#thread-safety>.
222 */ 222 */
223 223
224Arena ThreadArena(Thread thread) 224Arena ThreadArena(Thread thread)
diff --git a/mps/code/thlii4.c b/mps/code/thlii4.c
index b4b7149c56b..29760d32227 100644
--- a/mps/code/thlii4.c
+++ b/mps/code/thlii4.c
@@ -52,7 +52,7 @@ SRCID(thlii4, "$Id$");
52/* ThreadStruct -- thread desriptor */ 52/* ThreadStruct -- thread desriptor */
53 53
54typedef struct ThreadStruct { /* PThreads thread structure */ 54typedef struct ThreadStruct { /* PThreads thread structure */
55 Sig sig; /* design.mps.sig */ 55 Sig sig; /* <design/sig/> */
56 Serial serial; /* from arena->threadSerial */ 56 Serial serial; /* from arena->threadSerial */
57 Arena arena; /* owning arena */ 57 Arena arena; /* owning arena */
58 RingStruct arenaRing; /* threads attached to arena */ 58 RingStruct arenaRing; /* threads attached to arena */
@@ -218,7 +218,7 @@ Thread ThreadRingThread(Ring threadRing)
218 218
219/* ThreadArena -- get the arena of a thread 219/* ThreadArena -- get the arena of a thread
220 * 220 *
221 * Must be thread-safe. See design.mps.interface.c.thread-safety. 221 * Must be thread-safe. See <design/interface-c/#thread-safety>.
222 */ 222 */
223 223
224Arena ThreadArena(Thread thread) 224Arena ThreadArena(Thread thread)
diff --git a/mps/code/thw3i3.c b/mps/code/thw3i3.c
index 6d550445e7c..fdbf7ee6374 100644
--- a/mps/code/thw3i3.c
+++ b/mps/code/thw3i3.c
@@ -84,7 +84,7 @@ SRCID(thw3i3, "$Id$");
84 84
85 85
86typedef struct ThreadStruct { /* Win32 thread structure */ 86typedef struct ThreadStruct { /* Win32 thread structure */
87 Sig sig; /* design.mps.sig */ 87 Sig sig; /* <design/sig/> */
88 Serial serial; /* from arena->threadSerial */ 88 Serial serial; /* from arena->threadSerial */
89 Arena arena; /* owning arena */ 89 Arena arena; /* owning arena */
90 RingStruct arenaRing; /* threads attached to arena */ 90 RingStruct arenaRing; /* threads attached to arena */
@@ -303,7 +303,7 @@ Res ThreadScan(ScanState ss, Thread thread, void *stackBot)
303 return ResOK; 303 return ResOK;
304} 304}
305 305
306/* Must be thread-safe. See design.mps.interface.c.thread-safety. */ 306/* Must be thread-safe. See <design/interface-c/#thread-safety>. */
307Arena ThreadArena(Thread thread) 307Arena ThreadArena(Thread thread)
308{ 308{
309 /* Can't AVER thread as that would not be thread-safe */ 309 /* Can't AVER thread as that would not be thread-safe */
diff --git a/mps/code/trace.c b/mps/code/trace.c
index 70892618e1c..d72f5aff1bf 100644
--- a/mps/code/trace.c
+++ b/mps/code/trace.c
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .design: design.mps.trace. */ 6 * .design: <design/trace/>. */
7 7
8#include "chain.h" 8#include "chain.h"
9#include "mpm.h" 9#include "mpm.h"
@@ -101,7 +101,7 @@ static MessageClassStruct TraceMessageClassStruct = {
101 TraceMessageLiveSize, /* GCLiveSize */ 101 TraceMessageLiveSize, /* GCLiveSize */
102 TraceMessageCondemnedSize, /* GCCondemnedSize */ 102 TraceMessageCondemnedSize, /* GCCondemnedSize */
103 TraceMessageNotCondemnedSize, /* GCNotCondemnedSize */ 103 TraceMessageNotCondemnedSize, /* GCNotCondemnedSize */
104 MessageClassSig /* design.mps.message.class.sig.double */ 104 MessageClassSig /* <design/message/#class.sig.double> */
105}; 105};
106 106
107static void TraceMessageInit(Arena arena, TraceMessage tMessage) 107static void TraceMessageInit(Arena arena, TraceMessage tMessage)
@@ -578,7 +578,7 @@ static void traceFlip(Trace trace)
578 /* needs to change when we flip later (i.e. have a read-barrier */ 578 /* needs to change when we flip later (i.e. have a read-barrier */
579 /* collector), so that we allocate grey or white before the flip */ 579 /* collector), so that we allocate grey or white before the flip */
580 /* and black afterwards. For instance, see */ 580 /* and black afterwards. For instance, see */
581 /* design.mps.poolams.invariant.alloc. */ 581 /* <design/poolams/#invariant.alloc>. */
582 582
583 /* Now that the mutator is black we must prevent it from reading */ 583 /* Now that the mutator is black we must prevent it from reading */
584 /* grey objects so that it can't obtain white pointers. This is */ 584 /* grey objects so that it can't obtain white pointers. This is */
@@ -640,7 +640,7 @@ Res TraceCreate(Trace *traceReturn, Arena arena)
640 640
641found: 641found:
642 trace = ArenaTrace(arena, ti); 642 trace = ArenaTrace(arena, ti);
643 AVER(trace->sig == SigInvalid); /* design.mps.arena.trace.invalid */ 643 AVER(trace->sig == SigInvalid); /* <design/arena/#trace.invalid> */
644 644
645 trace->arena = arena; 645 trace->arena = arena;
646 trace->white = ZoneSetEMPTY; 646 trace->white = ZoneSetEMPTY;
@@ -945,7 +945,7 @@ static Res traceScanSegRes(TraceSet ts, Rank rank, Arena arena, Seg seg)
945 }); 945 });
946 946
947 /* following is true whether or not scan was total */ 947 /* following is true whether or not scan was total */
948 /* See design.mps.scan.summary.subset. */ 948 /* See <design/scan/#summary.subset>. */
949 AVER(RefSetSub(ss.unfixedSummary, SegSummary(seg))); 949 AVER(RefSetSub(ss.unfixedSummary, SegSummary(seg)));
950 950
951 if (res != ResOK || !wasTotal) { 951 if (res != ResOK || !wasTotal) {
@@ -1057,7 +1057,7 @@ Res TraceFix(ScanState ss, Ref *refIO)
1057 Tract tract; 1057 Tract tract;
1058 Pool pool; 1058 Pool pool;
1059 1059
1060 /* See design.mps.trace.fix.noaver */ 1060 /* See <design/trace/#fix.noaver> */
1061 AVERT_CRITICAL(ScanState, ss); 1061 AVERT_CRITICAL(ScanState, ss);
1062 AVER_CRITICAL(refIO != NULL); 1062 AVER_CRITICAL(refIO != NULL);
1063 1063
@@ -1085,7 +1085,7 @@ Res TraceFix(ScanState ss, Ref *refIO)
1085 } 1085 }
1086 } else { 1086 } else {
1087 /* Tract isn't white. Don't compute seg for non-statistical */ 1087 /* Tract isn't white. Don't compute seg for non-statistical */
1088 /* variety. See design.mps.trace.fix.tractofaddr */ 1088 /* variety. See <design/trace/#fix.tractofaddr> */
1089 STATISTIC_STAT 1089 STATISTIC_STAT
1090 ({ 1090 ({
1091 Seg seg; 1091 Seg seg;
@@ -1096,12 +1096,12 @@ Res TraceFix(ScanState ss, Ref *refIO)
1096 }); 1096 });
1097 } 1097 }
1098 } else { 1098 } else {
1099 /* See design.mps.trace.exact.legal */ 1099 /* See <design/trace/#exact.legal> */
1100 AVER(ss->rank < RankEXACT 1100 AVER(ss->rank < RankEXACT
1101 || !ArenaIsReservedAddr(ss->arena, ref)); 1101 || !ArenaIsReservedAddr(ss->arena, ref));
1102 } 1102 }
1103 1103
1104 /* See design.mps.trace.fix.fixed.all */ 1104 /* See <design/trace/#fix.fixed.all> */
1105 ss->fixedSummary = RefSetAdd(ss->arena, ss->fixedSummary, *refIO); 1105 ss->fixedSummary = RefSetAdd(ss->arena, ss->fixedSummary, *refIO);
1106 1106
1107 return ResOK; 1107 return ResOK;
@@ -1138,7 +1138,7 @@ Res TraceFixEmergency(ScanState ss, Ref *refIO)
1138 } 1138 }
1139 } else { 1139 } else {
1140 /* Tract isn't white. Don't compute seg for non-statistical */ 1140 /* Tract isn't white. Don't compute seg for non-statistical */
1141 /* variety. See design.mps.trace.fix.tractofaddr */ 1141 /* variety. See <design/trace/#fix.tractofaddr> */
1142 STATISTIC_STAT 1142 STATISTIC_STAT
1143 ({ 1143 ({
1144 Seg seg; 1144 Seg seg;
@@ -1149,12 +1149,12 @@ Res TraceFixEmergency(ScanState ss, Ref *refIO)
1149 }); 1149 });
1150 } 1150 }
1151 } else { 1151 } else {
1152 /* See design.mps.trace.exact.legal */ 1152 /* See <design/trace/#exact.legal> */
1153 AVER(ss->rank < RankEXACT || 1153 AVER(ss->rank < RankEXACT ||
1154 !ArenaIsReservedAddr(ss->arena, ref)); 1154 !ArenaIsReservedAddr(ss->arena, ref));
1155 } 1155 }
1156 1156
1157 /* See design.mps.trace.fix.fixed.all */ 1157 /* See <design/trace/#fix.fixed.all> */
1158 ss->fixedSummary = RefSetAdd(ss->arena, ss->fixedSummary, *refIO); 1158 ss->fixedSummary = RefSetAdd(ss->arena, ss->fixedSummary, *refIO);
1159 1159
1160 return ResOK; 1160 return ResOK;
@@ -1358,7 +1358,7 @@ double TraceWorkFactor = 0.25;
1358 * recently returned from TraceCreate, with some condemned segments 1358 * recently returned from TraceCreate, with some condemned segments
1359 * added. mortality is the fraction of the condemned set expected to 1359 * added. mortality is the fraction of the condemned set expected to
1360 * survive. finishingTime is relative to the current polling clock, see 1360 * survive. finishingTime is relative to the current polling clock, see
1361 * design.mps.arena.poll.clock. 1361 * <design/arena/#poll.clock>.
1362 * 1362 *
1363 * .start.black: All segments are black w.r.t. a newly allocated trace. 1363 * .start.black: All segments are black w.r.t. a newly allocated trace.
1364 * However, if TraceStart initialized segments to black when it 1364 * However, if TraceStart initialized segments to black when it
diff --git a/mps/code/tract.c b/mps/code/tract.c
index 04aec3811ed..e79f0e9846e 100644
--- a/mps/code/tract.c
+++ b/mps/code/tract.c
@@ -411,14 +411,14 @@ Bool TractOfAddr(Tract *tractReturn, Arena arena, Addr addr)
411 Index i; 411 Index i;
412 Chunk chunk; 412 Chunk chunk;
413 413
414 /* design.mps.trace.fix.noaver */ 414 /* <design/trace/#fix.noaver> */
415 AVER_CRITICAL(tractReturn != NULL); /* .tract.critical */ 415 AVER_CRITICAL(tractReturn != NULL); /* .tract.critical */
416 AVERT_CRITICAL(Arena, arena); 416 AVERT_CRITICAL(Arena, arena);
417 417
418 b = ChunkOfAddr(&chunk, arena, addr); 418 b = ChunkOfAddr(&chunk, arena, addr);
419 if (!b) 419 if (!b)
420 return FALSE; 420 return FALSE;
421 /* design.mps.trace.fix.tractofaddr */ 421 /* <design/trace/#fix.tractofaddr> */
422 i = INDEX_OF_ADDR(chunk, addr); 422 i = INDEX_OF_ADDR(chunk, addr);
423 /* .addr.free: If the page is recorded as being free then */ 423 /* .addr.free: If the page is recorded as being free then */
424 /* either the page is free or it is */ 424 /* either the page is free or it is */
@@ -446,7 +446,7 @@ Tract TractOfBaseAddr(Arena arena, Addr addr)
446 AVERT_CRITICAL(Arena, arena); 446 AVERT_CRITICAL(Arena, arena);
447 AVER_CRITICAL(AddrIsAligned(addr, arena->alignment)); 447 AVER_CRITICAL(AddrIsAligned(addr, arena->alignment));
448 448
449 /* Check first in the cache, see design.mps.arena.tract.cache. */ 449 /* Check first in the cache, see <design/arena/#tract.cache>. */
450 if (arena->lastTractBase == addr) { 450 if (arena->lastTractBase == addr) {
451 tract = arena->lastTract; 451 tract = arena->lastTract;
452 } else { 452 } else {
diff --git a/mps/code/tract.h b/mps/code/tract.h
index 1a7f56f1b14..a08b1d655a6 100644
--- a/mps/code/tract.h
+++ b/mps/code/tract.h
@@ -15,14 +15,14 @@
15/* TractStruct -- tract structure 15/* TractStruct -- tract structure
16 * 16 *
17 * .tract: Tracts represent the grains of memory allocation from 17 * .tract: Tracts represent the grains of memory allocation from
18 * the arena. See design.mps.arena. 18 * the arena. See <design/arena/>.
19 * 19 *
20 * .bool: The hasSeg field is a boolean, but can't be represented 20 * .bool: The hasSeg field is a boolean, but can't be represented
21 * as type Bool. See design.mps.arena.tract.field.hasSeg. 21 * as type Bool. See <design/arena/#tract.field.hasSeg>.
22 */ 22 */
23 23
24typedef struct TractStruct { /* Tract structure */ 24typedef struct TractStruct { /* Tract structure */
25 Pool pool; /* MUST BE FIRST (design.mps.arena.tract.field pool) */ 25 Pool pool; /* MUST BE FIRST (<design/arena/#tract.field> pool) */
26 void *p; /* pointer for use of owning pool */ 26 void *p; /* pointer for use of owning pool */
27 Addr base; /* Base address of the tract */ 27 Addr base; /* Base address of the tract */
28 TraceSet white : TraceLIMIT; /* traces for which tract is white */ 28 TraceSet white : TraceLIMIT; /* traces for which tract is white */
@@ -66,10 +66,10 @@ extern void TractFinish(Tract tract);
66 * 66 *
67 * .page-table: The page table (defined as a PageStruct array) 67 * .page-table: The page table (defined as a PageStruct array)
68 * is central to the design of the arena. 68 * is central to the design of the arena.
69 * See design.mps.arena.vm.table.*. 69 * See <design/arenavm/#table>.*.
70 * 70 *
71 * .page: The "pool" field must be the first field of the "tail" 71 * .page: The "pool" field must be the first field of the "tail"
72 * field of this union. See design.mps.arena.tract.field.pool. 72 * field of this union. See <design/arena/#tract.field.pool>.
73 * 73 *
74 * .states: Pages (hence PageStructs that describe them) can be in 74 * .states: Pages (hence PageStructs that describe them) can be in
75 * one of 3 states: 75 * one of 3 states:
@@ -118,7 +118,7 @@ typedef struct PageStruct { /* page structure */
118 118
119/* PageIsAllocated -- is a page allocated? 119/* PageIsAllocated -- is a page allocated?
120 * 120 *
121 * See design.mps.arena.vm.table.disc. 121 * See <design/arenavm/#table.disc>.
122 */ 122 */
123 123
124#define PageIsAllocated(page) ((page)->the.rest.pool != NULL) 124#define PageIsAllocated(page) ((page)->the.rest.pool != NULL)
@@ -134,7 +134,7 @@ typedef struct PageStruct { /* page structure */
134#define ChunkSig ((Sig)0x519C804C) /* SIGnature CHUNK */ 134#define ChunkSig ((Sig)0x519C804C) /* SIGnature CHUNK */
135 135
136typedef struct ChunkStruct { 136typedef struct ChunkStruct {
137 Sig sig; /* design.mps.sig */ 137 Sig sig; /* <design/sig/> */
138 Serial serial; /* serial within the arena */ 138 Serial serial; /* serial within the arena */
139 Arena arena; /* parent arena */ 139 Arena arena; /* parent arena */
140 RingStruct chunkRing; /* ring of all chunks in arena */ 140 RingStruct chunkRing; /* ring of all chunks in arena */
@@ -224,7 +224,7 @@ extern Index IndexOfAddr(Chunk chunk, Addr addr);
224 224
225/* PageIndexBase -- map page index to base address of page 225/* PageIndexBase -- map page index to base address of page
226 * 226 *
227 * See design.mps.arena.vm.table.linear 227 * See <design/arenavm/#table.linear>
228 */ 228 */
229 229
230#define PageIndexBase(chunk, i) \ 230#define PageIndexBase(chunk, i) \
@@ -248,7 +248,7 @@ extern Bool TractNext(Tract *tractReturn, Arena arena, Addr addr);
248 248
249/* TRACT_TRACT_FOR -- iterate over a range of tracts 249/* TRACT_TRACT_FOR -- iterate over a range of tracts
250 * 250 *
251 * See design.mps.arena.tract-iter.if.macro. 251 * See <design/arena/#tract-iter.if.macro>.
252 * Parameters arena & limit are evaluated multiple times. 252 * Parameters arena & limit are evaluated multiple times.
253 * Check first tract & last tract lie with the same chunk. 253 * Check first tract & last tract lie with the same chunk.
254 */ 254 */
@@ -265,7 +265,7 @@ extern Bool TractNext(Tract *tractReturn, Arena arena, Addr addr);
265 265
266/* TRACT_FOR -- iterate over a range of tracts 266/* TRACT_FOR -- iterate over a range of tracts
267 * 267 *
268 * See design.mps.arena.tract.for. 268 * See <design/arena/#tract.for>.
269 * Parameters arena & limit are evaluated multiple times. 269 * Parameters arena & limit are evaluated multiple times.
270 */ 270 */
271 271
diff --git a/mps/code/version.c b/mps/code/version.c
index a2978fc0e5b..f7b3078948f 100644
--- a/mps/code/version.c
+++ b/mps/code/version.c
@@ -10,7 +10,7 @@
10 * 10 *
11 * DESIGN 11 * DESIGN
12 * 12 *
13 * .design: See design.mps.version-library, but to let you in on a 13 * .design: See <design/version/>-library, but to let you in on a
14 * secret it works by declaring a string with all the necessary info 14 * secret it works by declaring a string with all the necessary info
15 * in. 15 * in.
16 */ 16 */
diff --git a/mps/code/vman.c b/mps/code/vman.c
index 76935e2cb64..aaec2a4345f 100644
--- a/mps/code/vman.c
+++ b/mps/code/vman.c
@@ -16,9 +16,9 @@ SRCID(vman, "$Id$");
16 16
17#define VMSig ((Sig)0x519B3999) /* SIGnature VM */ 17#define VMSig ((Sig)0x519B3999) /* SIGnature VM */
18 18
19/* ANSI fake VM structure, see design.mps.vman */ 19/* ANSI fake VM structure, see <design/vman/> */
20typedef struct VMStruct { 20typedef struct VMStruct {
21 Sig sig; /* design.mps.sig */ 21 Sig sig; /* <design/sig/> */
22 Addr base, limit; /* boundaries of malloc'd memory */ 22 Addr base, limit; /* boundaries of malloc'd memory */
23 void *block; /* pointer to malloc'd block, for free() */ 23 void *block; /* pointer to malloc'd block, for free() */
24 Size reserved; /* total reserved address space */ 24 Size reserved; /* total reserved address space */
diff --git a/mps/code/vmfr.c b/mps/code/vmfr.c
index a8d33de92ae..ce87e1b8431 100644
--- a/mps/code/vmfr.c
+++ b/mps/code/vmfr.c
@@ -7,7 +7,7 @@
7 * interface (vm.h) for FreeBSD. It was created by copying vmli.c (the 7 * interface (vm.h) for FreeBSD. It was created by copying vmli.c (the
8 * DIGITAL UNIX implementation) as that seemed to be closest. 8 * DIGITAL UNIX implementation) as that seemed to be closest.
9 * 9 *
10 * .design: See design.mps.vm. .design.freebsd: mmap(2) is used to 10 * .design: See <design/vm/>. .design.freebsd: mmap(2) is used to
11 * reserve address space by creating a mapping with page access none. 11 * reserve address space by creating a mapping with page access none.
12 * mmap(2) is used to map pages onto store by creating a copy-on-write 12 * mmap(2) is used to map pages onto store by creating a copy-on-write
13 * (MAP_PRIVATE) mapping with the flag MAP_ANON. 13 * (MAP_PRIVATE) mapping with the flag MAP_ANON.
@@ -51,7 +51,7 @@ SRCID(vmfr, "$Id$");
51#define VMSig ((Sig)0x519B3999) /* SIGnature VM */ 51#define VMSig ((Sig)0x519B3999) /* SIGnature VM */
52 52
53typedef struct VMStruct { 53typedef struct VMStruct {
54 Sig sig; /* design.mps.sig */ 54 Sig sig; /* <design/sig/> */
55 Align align; /* page size */ 55 Align align; /* page size */
56 Addr base, limit; /* boundaries of reserved space */ 56 Addr base, limit; /* boundaries of reserved space */
57 Size reserved; /* total reserved address space */ 57 Size reserved; /* total reserved address space */
@@ -266,7 +266,7 @@ void VMUnmap(VM vm, Addr base, Addr limit)
266 266
267 size = AddrOffset(base, limit); 267 size = AddrOffset(base, limit);
268 268
269 /* see design.mps.vmo1.fun.unmap.offset */ 269 /* see <design/vmo1/#fun.unmap.offset> */
270 addr = mmap((void *)base, (size_t)size, 270 addr = mmap((void *)base, (size_t)size,
271 PROT_NONE, MAP_ANON | MAP_PRIVATE | MAP_FIXED, 271 PROT_NONE, MAP_ANON | MAP_PRIVATE | MAP_FIXED,
272 -1, 0); 272 -1, 0);
diff --git a/mps/code/vmi5.c b/mps/code/vmi5.c
index 3d712589337..20934f9698d 100644
--- a/mps/code/vmi5.c
+++ b/mps/code/vmi5.c
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * Design: design.mps.vm 6 * Design: <design/vm/>
7 * 7 *
8 * This is the implementation of the virtual memory mapping interface 8 * This is the implementation of the virtual memory mapping interface
9 * (vm.h) for IRIX 5.x. 9 * (vm.h) for IRIX 5.x.
@@ -60,7 +60,7 @@ SRCID(vmi5, "$Id$");
60 60
61/* The name zero_fd is a transgression, see .fildes.name. */ 61/* The name zero_fd is a transgression, see .fildes.name. */
62typedef struct VMStruct { 62typedef struct VMStruct {
63 Sig sig; /* design.mps.sig */ 63 Sig sig; /* <design/sig/> */
64 int zero_fd; /* fildes for mmap */ 64 int zero_fd; /* fildes for mmap */
65 Align align; /* page size */ 65 Align align; /* page size */
66 Addr base, limit; /* boundaries of reserved space */ 66 Addr base, limit; /* boundaries of reserved space */
diff --git a/mps/code/vmli.c b/mps/code/vmli.c
index 6c4d0d53246..251cf0792b5 100644
--- a/mps/code/vmli.c
+++ b/mps/code/vmli.c
@@ -7,7 +7,7 @@
7 * interface (vm.h) for Linux. It was created by copying vmo1.c (the 7 * interface (vm.h) for Linux. It was created by copying vmo1.c (the
8 * DIGITAL UNIX implementation) as that seemed to be closest. 8 * DIGITAL UNIX implementation) as that seemed to be closest.
9 * 9 *
10 * .design: See design.mps.vm. .design.linux: mmap(2) is used to 10 * .design: See <design/vm/>. .design.linux: mmap(2) is used to
11 * reserve address space by creating a mapping with page access none. 11 * reserve address space by creating a mapping with page access none.
12 * mmap(2) is used to map pages onto store by creating a copy-on-write 12 * mmap(2) is used to map pages onto store by creating a copy-on-write
13 * (MAP_PRIVATE) mapping with the flag MAP_ANONYMOUS. 13 * (MAP_PRIVATE) mapping with the flag MAP_ANONYMOUS.
@@ -63,7 +63,7 @@ SRCID(vmli, "$Id$");
63#define VMSig ((Sig)0x519B3999) /* SIGnature VM */ 63#define VMSig ((Sig)0x519B3999) /* SIGnature VM */
64 64
65typedef struct VMStruct { 65typedef struct VMStruct {
66 Sig sig; /* design.mps.sig */ 66 Sig sig; /* <design/sig/> */
67 Align align; /* page size */ 67 Align align; /* page size */
68 Addr base, limit; /* boundaries of reserved space */ 68 Addr base, limit; /* boundaries of reserved space */
69 Size reserved; /* total reserved address space */ 69 Size reserved; /* total reserved address space */
@@ -282,7 +282,7 @@ void VMUnmap(VM vm, Addr base, Addr limit)
282 282
283 size = AddrOffset(base, limit); 283 size = AddrOffset(base, limit);
284 284
285 /* see design.mps.vmo1.fun.unmap.offset */ 285 /* see <design/vmo1/#fun.unmap.offset> */
286 addr = mmap((void *)base, (size_t)size, 286 addr = mmap((void *)base, (size_t)size,
287 PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, 287 PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED,
288 -1, 0); 288 -1, 0);
diff --git a/mps/code/vmo1.c b/mps/code/vmo1.c
index ea75bc65785..dc65879ca30 100644
--- a/mps/code/vmo1.c
+++ b/mps/code/vmo1.c
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .design: design.mps.vm, design.mps.vmo1 6 * .design: <design/vm/>, <design/vmo1/>
7 * 7 *
8 * .status: A bit hacky, but probably working. 8 * .status: A bit hacky, but probably working.
9 * 9 *
@@ -61,7 +61,7 @@ extern int getpagesize(void);
61#define VMSig ((Sig)0x519B3999) /* SIGnature VM */ 61#define VMSig ((Sig)0x519B3999) /* SIGnature VM */
62 62
63typedef struct VMStruct { 63typedef struct VMStruct {
64 Sig sig; /* design.mps.sig */ 64 Sig sig; /* <design/sig/> */
65 Align align; /* page size */ 65 Align align; /* page size */
66 Addr base, limit; /* boundaries of reserved space */ 66 Addr base, limit; /* boundaries of reserved space */
67 Size reserved; /* total reserved address space */ 67 Size reserved; /* total reserved address space */
@@ -269,7 +269,7 @@ Res VMMap(VM vm, Addr base, Addr limit)
269 269
270/* VMUnmap -- unmap the given range of memory 270/* VMUnmap -- unmap the given range of memory
271 * 271 *
272 * See design.mps.vmo1.fun.unmap. 272 * See <design/vmo1/#fun.unmap>.
273 */ 273 */
274 274
275void VMUnmap(VM vm, Addr base, Addr limit) 275void VMUnmap(VM vm, Addr base, Addr limit)
@@ -287,7 +287,7 @@ void VMUnmap(VM vm, Addr base, Addr limit)
287 287
288 size = AddrOffset(base, limit); 288 size = AddrOffset(base, limit);
289 289
290 /* see design.mps.vmo1.fun.unmap.offset */ 290 /* see <design/vmo1/#fun.unmap.offset> */
291 addr = mmap((void *)base, (size_t)size, 291 addr = mmap((void *)base, (size_t)size,
292 PROT_NONE, MAP_FILE | MAP_SHARED | MAP_FIXED, 292 PROT_NONE, MAP_FILE | MAP_SHARED | MAP_FIXED,
293 vm->none_fd, (off_t)AddrOffset(vm->base, base)); 293 vm->none_fd, (off_t)AddrOffset(vm->base, base));
diff --git a/mps/code/vmso.c b/mps/code/vmso.c
index f3d1059cb18..2329a034318 100644
--- a/mps/code/vmso.c
+++ b/mps/code/vmso.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * DESIGN 6 * DESIGN
7 * 7 *
8 * .design: design.mps.vmso 8 * .design: <design/vmso/>
9 * 9 *
10 * PURPOSE 10 * PURPOSE
11 * 11 *
@@ -68,7 +68,7 @@ extern int munmap(caddr_t addr, size_t len);
68 68
69/* The names of zero_fd and none_fd are transgressions, see .fildes.name */ 69/* The names of zero_fd and none_fd are transgressions, see .fildes.name */
70typedef struct VMStruct { 70typedef struct VMStruct {
71 Sig sig; /* design.mps.sig */ 71 Sig sig; /* <design/sig/> */
72 int zero_fd; /* fildes for mmap */ 72 int zero_fd; /* fildes for mmap */
73 int none_fd; /* fildes for mmap */ 73 int none_fd; /* fildes for mmap */
74 Align align; /* page size */ 74 Align align; /* page size */
diff --git a/mps/code/vmsu.c b/mps/code/vmsu.c
index 34c62a17eed..81513ee433b 100644
--- a/mps/code/vmsu.c
+++ b/mps/code/vmsu.c
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .design: See design.mps.vm for general design. 6 * .design: See <design/vm/> for general design.
7 * 7 *
8 * mmap(2) is used to reserve address space by creating a mapping to 8 * mmap(2) is used to reserve address space by creating a mapping to
9 * /etc/passwd with page access none. mmap(2) is used to map pages 9 * /etc/passwd with page access none. mmap(2) is used to map pages
@@ -65,7 +65,7 @@ extern int getpagesize(void);
65 65
66/* The names of zero_fd and none_fd are transgressions, see .fildes.name */ 66/* The names of zero_fd and none_fd are transgressions, see .fildes.name */
67typedef struct VMStruct { 67typedef struct VMStruct {
68 Sig sig; /* design.mps.sig */ 68 Sig sig; /* <design/sig/> */
69 int zero_fd; /* fildes for mmap, see impl.c.vms{o,u} */ 69 int zero_fd; /* fildes for mmap, see impl.c.vms{o,u} */
70 int none_fd; /* fildes for mmap, see impl.c.vms{o,u} */ 70 int none_fd; /* fildes for mmap, see impl.c.vms{o,u} */
71 Align align; /* page size */ 71 Align align; /* page size */
diff --git a/mps/code/vmw3.c b/mps/code/vmw3.c
index 462d75e29f6..1e667151cf0 100644
--- a/mps/code/vmw3.c
+++ b/mps/code/vmw3.c
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .design: See design.mps.vm. 6 * .design: See <design/vm/>.
7 * 7 *
8 * .purpose: This is the implementation of the virtual memory mapping 8 * .purpose: This is the implementation of the virtual memory mapping
9 * interface (vm.h) for Win32s. 9 * interface (vm.h) for Win32s.
@@ -63,7 +63,7 @@ SRCID(vmw3, "$Id$");
63#define VMSig ((Sig)0x519B3999) /* SIGnature VM */ 63#define VMSig ((Sig)0x519B3999) /* SIGnature VM */
64 64
65typedef struct VMStruct { 65typedef struct VMStruct {
66 Sig sig; /* design.mps.sig */ 66 Sig sig; /* <design/sig/> */
67 Align align; /* page size */ 67 Align align; /* page size */
68 Addr base, limit; /* boundaries of reserved space */ 68 Addr base, limit; /* boundaries of reserved space */
69 Size reserved; /* total reserved address space */ 69 Size reserved; /* total reserved address space */
diff --git a/mps/code/vmxc.c b/mps/code/vmxc.c
index 7cb53ca5725..737ac2b4204 100644
--- a/mps/code/vmxc.c
+++ b/mps/code/vmxc.c
@@ -3,7 +3,7 @@
3 * $Id$ 3 * $Id$
4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. 4 * Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
5 * 5 *
6 * .design: design.mps.vm 6 * .design: <design/vm/>
7 * 7 *
8 * .details: mmap(2) is used to reserve address space by creating a 8 * .details: mmap(2) is used to reserve address space by creating a
9 * mapping to the swap with page access none. mmap(2) is used to map 9 * mapping to the swap with page access none. mmap(2) is used to map
@@ -46,7 +46,7 @@ SRCID(vmxc, "$Id$");
46#define VMSig ((Sig)0x519B3999) /* SIGnature VM */ 46#define VMSig ((Sig)0x519B3999) /* SIGnature VM */
47 47
48typedef struct VMStruct { 48typedef struct VMStruct {
49 Sig sig; /* design.mps.sig */ 49 Sig sig; /* <design/sig/> */
50 Align align; /* page size */ 50 Align align; /* page size */
51 Addr base, limit; /* boundaries of reserved space */ 51 Addr base, limit; /* boundaries of reserved space */
52 Size reserved; /* total reserved address space */ 52 Size reserved; /* total reserved address space */
diff --git a/mps/code/walk.c b/mps/code/walk.c
index 42f2cd21c3a..acbcbdb7454 100644
--- a/mps/code/walk.c
+++ b/mps/code/walk.c
@@ -254,11 +254,11 @@ static Res RootsWalkFix(ScanState ss, Ref *refIO)
254 rsc->f((mps_addr_t*)refIO, (mps_root_t)rsc->root, rsc->p, rsc->s); 254 rsc->f((mps_addr_t*)refIO, (mps_root_t)rsc->root, rsc->p, rsc->s);
255 } 255 }
256 } else { 256 } else {
257 /* See design.mps.trace.exact.legal */ 257 /* See <design/trace/#exact.legal> */
258 AVER(ss->rank < RankEXACT || !ArenaIsReservedAddr(arena, ref)); 258 AVER(ss->rank < RankEXACT || !ArenaIsReservedAddr(arena, ref));
259 } 259 }
260 260
261 /* See design.mps.trace.fix.fixed.all */ 261 /* See <design/trace/#fix.fixed.all> */
262 ss->fixedSummary = RefSetAdd(ss->arena, ss->fixedSummary, *refIO); 262 ss->fixedSummary = RefSetAdd(ss->arena, ss->fixedSummary, *refIO);
263 263
264 AVER(ref == *refIO); /* can walk object graph - but not modify it */ 264 AVER(ref == *refIO); /* can walk object graph - but not modify it */