aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code/buffer.c
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/buffer.c
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/buffer.c')
-rw-r--r--mps/code/buffer.c36
1 files changed, 18 insertions, 18 deletions
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