aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code
diff options
context:
space:
mode:
authorRichard Brooksby2012-09-01 10:18:08 +0100
committerRichard Brooksby2012-09-01 10:18:08 +0100
commit89a685f16488555436a7e70782ab3ac6132a59bf (patch)
tree8a59823a1955170f38ee11f600feef4bbc5e6128 /mps/code
parent4265ff2c625a8655d682baf86a690bed9025623a (diff)
downloademacs-89a685f16488555436a7e70782ab3ac6132a59bf.tar.gz
emacs-89a685f16488555436a7e70782ab3ac6132a59bf.zip
Renaming some check* macros with more accurate names, making remaining check* macros similar in function.
Copied from Perforce Change: 179155 ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
-rw-r--r--mps/code/arena.c8
-rw-r--r--mps/code/arenavm.c4
-rw-r--r--mps/code/buffer.c8
-rw-r--r--mps/code/cbs.c2
-rw-r--r--mps/code/check.h36
-rw-r--r--mps/code/dbgpool.c2
-rw-r--r--mps/code/dbgpooli.c8
-rw-r--r--mps/code/eventpro.c18
-rw-r--r--mps/code/eventrep.c10
-rw-r--r--mps/code/global.c4
-rw-r--r--mps/code/mpsi.c106
-rw-r--r--mps/code/pool.c2
-rw-r--r--mps/code/poolamc.c12
-rw-r--r--mps/code/poolams.c10
-rw-r--r--mps/code/poolmrg.c4
-rw-r--r--mps/code/poolmv.c4
-rw-r--r--mps/code/poolmv2.c4
-rw-r--r--mps/code/poolmvff.c4
-rw-r--r--mps/code/root.c4
-rw-r--r--mps/code/seg.c8
-rw-r--r--mps/code/vmw3.c4
21 files changed, 128 insertions, 134 deletions
diff --git a/mps/code/arena.c b/mps/code/arena.c
index 704d13f60db..c3fe88ebf19 100644
--- a/mps/code/arena.c
+++ b/mps/code/arena.c
@@ -26,7 +26,7 @@ static void ArenaTrivCompact(Arena arena, Trace trace);
26 26
27static Res ArenaTrivDescribe(Arena arena, mps_lib_FILE *stream) 27static Res ArenaTrivDescribe(Arena arena, mps_lib_FILE *stream)
28{ 28{
29 if (!CHECKT(Arena, arena)) return ResFAIL; 29 if (!TESTT(Arena, arena)) return ResFAIL;
30 if (stream == NULL) return ResFAIL; 30 if (stream == NULL) return ResFAIL;
31 31
32 /* .describe.triv.never-called-from-subclass-method: 32 /* .describe.triv.never-called-from-subclass-method:
@@ -324,7 +324,7 @@ Res ArenaDescribe(Arena arena, mps_lib_FILE *stream)
324 Res res; 324 Res res;
325 Size reserved; 325 Size reserved;
326 326
327 if (!CHECKT(Arena, arena)) return ResFAIL; 327 if (!TESTT(Arena, arena)) return ResFAIL;
328 if (stream == NULL) return ResFAIL; 328 if (stream == NULL) return ResFAIL;
329 329
330 res = WriteF(stream, "Arena $P {\n", (WriteFP)arena, 330 res = WriteF(stream, "Arena $P {\n", (WriteFP)arena,
@@ -396,7 +396,7 @@ Res ArenaDescribeTracts(Arena arena, mps_lib_FILE *stream)
396 Addr oldLimit, base, limit; 396 Addr oldLimit, base, limit;
397 Size size; 397 Size size;
398 398
399 if (!CHECKT(Arena, arena)) return ResFAIL; 399 if (!TESTT(Arena, arena)) return ResFAIL;
400 if (stream == NULL) return ResFAIL; 400 if (stream == NULL) return ResFAIL;
401 401
402 b = TractFirst(&tract, arena); 402 b = TractFirst(&tract, arena);
@@ -481,7 +481,7 @@ Res ControlDescribe(Arena arena, mps_lib_FILE *stream)
481{ 481{
482 Res res; 482 Res res;
483 483
484 if (!CHECKT(Arena, arena)) return ResFAIL; 484 if (!TESTT(Arena, arena)) return ResFAIL;
485 if (stream == NULL) return ResFAIL; 485 if (stream == NULL) return ResFAIL;
486 486
487 res = PoolDescribe(ArenaControlPool(arena), stream); 487 res = PoolDescribe(ArenaControlPool(arena), stream);
diff --git a/mps/code/arenavm.c b/mps/code/arenavm.c
index 81caf8bead5..87d7a797d37 100644
--- a/mps/code/arenavm.c
+++ b/mps/code/arenavm.c
@@ -202,10 +202,10 @@ static Res VMArenaDescribe(Arena arena, mps_lib_FILE *stream)
202 VMArena vmArena; 202 VMArena vmArena;
203 Index gen; 203 Index gen;
204 204
205 if (!CHECKT(Arena, arena)) return ResFAIL; 205 if (!TESTT(Arena, arena)) return ResFAIL;
206 if (stream == NULL) return ResFAIL; 206 if (stream == NULL) return ResFAIL;
207 vmArena = Arena2VMArena(arena); 207 vmArena = Arena2VMArena(arena);
208 if (!CHECKT(VMArena, vmArena)) return ResFAIL; 208 if (!TESTT(VMArena, vmArena)) return ResFAIL;
209 209
210 /* Describe the superclass fields first via next-method call */ 210 /* Describe the superclass fields first via next-method call */
211 /* ...but the next method is ArenaTrivDescribe, so don't call it; 211 /* ...but the next method is ArenaTrivDescribe, so don't call it;
diff --git a/mps/code/buffer.c b/mps/code/buffer.c
index d8346c49e9c..9b7748c6572 100644
--- a/mps/code/buffer.c
+++ b/mps/code/buffer.c
@@ -149,7 +149,7 @@ Res BufferDescribe(Buffer buffer, mps_lib_FILE *stream)
149 Res res; 149 Res res;
150 char abzMode[5]; 150 char abzMode[5];
151 151
152 if (!CHECKT(Buffer, buffer)) return ResFAIL; 152 if (!TESTT(Buffer, buffer)) return ResFAIL;
153 if (stream == NULL) return ResFAIL; 153 if (stream == NULL) return ResFAIL;
154 154
155 abzMode[0] = (char)( (buffer->mode & BufferModeTRANSITION) ? 't' : '_' ); 155 abzMode[0] = (char)( (buffer->mode & BufferModeTRANSITION) ? 't' : '_' );
@@ -1185,7 +1185,7 @@ static void bufferNoReassignSeg (Buffer buffer, Seg seg)
1185 1185
1186static Res bufferTrivDescribe(Buffer buffer, mps_lib_FILE *stream) 1186static Res bufferTrivDescribe(Buffer buffer, mps_lib_FILE *stream)
1187{ 1187{
1188 if (!CHECKT(Buffer, buffer)) return ResFAIL; 1188 if (!TESTT(Buffer, buffer)) return ResFAIL;
1189 if (stream == NULL) return ResFAIL; 1189 if (stream == NULL) return ResFAIL;
1190 /* dispatching function does it all */ 1190 /* dispatching function does it all */
1191 return ResOK; 1191 return ResOK;
@@ -1444,10 +1444,10 @@ static Res segBufDescribe(Buffer buffer, mps_lib_FILE *stream)
1444 BufferClass super; 1444 BufferClass super;
1445 Res res; 1445 Res res;
1446 1446
1447 if (!CHECKT(Buffer, buffer)) return ResFAIL; 1447 if (!TESTT(Buffer, buffer)) return ResFAIL;
1448 if (stream == NULL) return ResFAIL; 1448 if (stream == NULL) return ResFAIL;
1449 segbuf = BufferSegBuf(buffer); 1449 segbuf = BufferSegBuf(buffer);
1450 if (!CHECKT(SegBuf, segbuf)) return ResFAIL; 1450 if (!TESTT(SegBuf, segbuf)) return ResFAIL;
1451 1451
1452 /* Describe the superclass fields first via next-method call */ 1452 /* Describe the superclass fields first via next-method call */
1453 super = BUFFER_SUPERCLASS(SegBufClass); 1453 super = BUFFER_SUPERCLASS(SegBufClass);
diff --git a/mps/code/cbs.c b/mps/code/cbs.c
index e3f5204e03e..df1a359e59a 100644
--- a/mps/code/cbs.c
+++ b/mps/code/cbs.c
@@ -1627,7 +1627,7 @@ Res CBSDescribe(CBS cbs, mps_lib_FILE *stream)
1627{ 1627{
1628 Res res; 1628 Res res;
1629 1629
1630 if (!CHECKT(CBS, cbs)) return ResFAIL; 1630 if (!TESTT(CBS, cbs)) return ResFAIL;
1631 if (stream == NULL) return ResFAIL; 1631 if (stream == NULL) return ResFAIL;
1632 1632
1633 res = WriteF(stream, 1633 res = WriteF(stream,
diff --git a/mps/code/check.h b/mps/code/check.h
index 78334f8d7d3..c43dcc1c3d2 100644
--- a/mps/code/check.h
+++ b/mps/code/check.h
@@ -155,16 +155,13 @@ enum {
155#endif 155#endif
156 156
157 157
158/* CHECKT -- check type simply 158/* TESTT -- check type simply
159 * 159 *
160 * Must be thread safe. See <design/interface-c/#thread-safety> 160 * Must be thread safe. See <design/interface-c/#thread-safety>
161 * and <design/interface-c/#check.space>. 161 * and <design/interface-c/#check.space>.
162 *
163 * @@@@ This is a test, not a CHECK macro -- it does not assert.
164 * It should be renamed TESTSIG. RHSK 2006-12-13.
165 */ 162 */
166 163
167#define CHECKT(type, val) ((val) != NULL && (val)->sig == type ## Sig) 164#define TESTT(type, val) ((val) != NULL && (val)->sig == type ## Sig)
168 165
169 166
170/* CHECKS -- Check Signature 167/* CHECKS -- Check Signature
@@ -173,10 +170,10 @@ enum {
173 */ 170 */
174 171
175#if defined(AVER_AND_CHECK_NONE) 172#if defined(AVER_AND_CHECK_NONE)
176#define CHECKS(type, val) DISCARD(CHECKT(type, val)) 173#define CHECKS(type, val) DISCARD(TESTT(type, val))
177#else 174#else
178#define CHECKS(type, val) \ 175#define CHECKS(type, val) \
179 ASSERT(CHECKT(type, val), "SigCheck " #type ": " #val) 176 ASSERT(TESTT(type, val), "SigCheck " #type ": " #val)
180#endif 177#endif
181 178
182 179
@@ -272,43 +269,40 @@ enum {
272 too minimal? How much do we rely on check methods? */ 269 too minimal? How much do we rely on check methods? */
273 270
274#define CHECKL(cond) DISCARD(cond) 271#define CHECKL(cond) DISCARD(cond)
275#define CHECKD(type, val) DISCARD(CHECKT(type, val)) 272#define CHECKD(type, val) DISCARD(TESTT(type, val))
276#define CHECKD_NOSIG(type, val) DISCARD((val) != NULL) 273#define CHECKD_NOSIG(type, val) DISCARD((val) != NULL)
277#define CHECKU(type, val) DISCARD(CHECKT(type, val)) 274#define CHECKU(type, val) DISCARD(TESTT(type, val))
278#define CHECKU_NOSIG(type, val) DISCARD((val) != NULL) 275#define CHECKU_NOSIG(type, val) DISCARD((val) != NULL)
279 276
280#endif /* AVER_AND_CHECK_ALL */ 277#endif /* AVER_AND_CHECK_ALL */
281 278
282 279
283/* CHECKLVALUE &c -- type compatibility checking 280/* COMPAT* -- type compatibility checking
284 * 281 *
285 * .check.macros: The CHECK* macros use some C trickery to attempt to 282 * .check.macros: The COMPAT* macros use some C trickery to attempt to
286 * verify that certain types and fields are equivalent. They do not 283 * verify that certain types and fields are equivalent. They do not
287 * do a complete job. This trickery is justified by the security gained 284 * do a complete job. This trickery is justified by the security gained
288 * in knowing that <code/mps.h> matches the MPM. See also 285 * in knowing that <code/mps.h> matches the MPM. See also
289 * mail.richard.1996-08-07.09-49. [This paragraph is intended to 286 * mail.richard.1996-08-07.09-49. [This paragraph is intended to
290 * satisfy rule.impl.trick.] 287 * satisfy rule.impl.trick.]
291 *
292 * @@@@ These are tests, not CHECK macros -- they do not assert.
293 * They should be renamed TESTTYPE etc. RHSK 2006-12-13.
294 */ 288 */
295 289
296/* compile-time check */ 290/* compile-time check */
297#define CHECKLVALUE(lv1, lv2) \ 291#define COMPATLVALUE(lv1, lv2) \
298 ((void)sizeof((lv1) = (lv2)), (void)sizeof((lv2) = (lv1)), TRUE) 292 ((void)sizeof((lv1) = (lv2)), (void)sizeof((lv2) = (lv1)), TRUE)
299 293
300/* aims to test whether t1 and t2 are assignment-compatible */ 294/* aims to test whether t1 and t2 are assignment-compatible */
301#define CHECKTYPE(t1, t2) \ 295#define COMPATTYPE(t1, t2) \
302 (sizeof(t1) == sizeof(t2) && \ 296 (sizeof(t1) == sizeof(t2) && \
303 CHECKLVALUE(*((t1 *)0), *((t2 *)0))) 297 COMPATLVALUE(*((t1 *)0), *((t2 *)0)))
304 298
305#define CHECKFIELDAPPROX(s1, f1, s2, f2) \ 299#define COMPATFIELDAPPROX(s1, f1, s2, f2) \
306 (sizeof(((s1 *)0)->f1) == sizeof(((s2 *)0)->f2) && \ 300 (sizeof(((s1 *)0)->f1) == sizeof(((s2 *)0)->f2) && \
307 offsetof(s1, f1) == offsetof(s2, f2)) 301 offsetof(s1, f1) == offsetof(s2, f2))
308 302
309#define CHECKFIELD(s1, f1, s2, f2) \ 303#define COMPATFIELD(s1, f1, s2, f2) \
310 (CHECKFIELDAPPROX(s1, f1, s2, f2) && \ 304 (COMPATFIELDAPPROX(s1, f1, s2, f2) && \
311 CHECKLVALUE(((s1 *)0)->f1, ((s2 *)0)->f2)) 305 COMPATLVALUE(((s1 *)0)->f1, ((s2 *)0)->f2))
312 306
313 307
314#endif /* check_h */ 308#endif /* check_h */
diff --git a/mps/code/dbgpool.c b/mps/code/dbgpool.c
index 79d14a77727..765372fae64 100644
--- a/mps/code/dbgpool.c
+++ b/mps/code/dbgpool.c
@@ -72,7 +72,7 @@ Bool PoolDebugMixinCheck(PoolDebugMixin debug)
72 CHECKL(TagInitMethodCheck(debug->tagInit)); 72 CHECKL(TagInitMethodCheck(debug->tagInit));
73 /* Nothing to check about tagSize */ 73 /* Nothing to check about tagSize */
74 CHECKD(Pool, debug->tagPool); 74 CHECKD(Pool, debug->tagPool);
75 CHECKL(CHECKTYPE(Addr, void*)); /* tagPool relies on this */ 75 CHECKL(COMPATTYPE(Addr, void*)); /* tagPool relies on this */
76 /* Nothing to check about missingTags */ 76 /* Nothing to check about missingTags */
77 CHECKL(SplayTreeCheck(&debug->index)); 77 CHECKL(SplayTreeCheck(&debug->index));
78 } 78 }
diff --git a/mps/code/dbgpooli.c b/mps/code/dbgpooli.c
index 52b6e7d3916..ebc8733e3c2 100644
--- a/mps/code/dbgpooli.c
+++ b/mps/code/dbgpooli.c
@@ -21,8 +21,8 @@ void mps_pool_check_fenceposts(mps_pool_t mps_pool)
21 Pool pool = (Pool)mps_pool; 21 Pool pool = (Pool)mps_pool;
22 Arena arena; 22 Arena arena;
23 23
24 /* CHECKT not AVERT, see <design/interface-c/#check.space */ 24 /* TESTT not AVERT, see <design/interface-c/#check.space */
25 AVER(CHECKT(Pool, pool)); 25 AVER(TESTT(Pool, pool));
26 arena = PoolArena(pool); 26 arena = PoolArena(pool);
27 27
28 ArenaEnter(arena); 28 ArenaEnter(arena);
@@ -41,8 +41,8 @@ void mps_pool_check_free_space(mps_pool_t mps_pool)
41 Pool pool = (Pool)mps_pool; 41 Pool pool = (Pool)mps_pool;
42 Arena arena; 42 Arena arena;
43 43
44 /* CHECKT not AVERT, see <design/interface-c/#check.space */ 44 /* TESTT not AVERT, see <design/interface-c/#check.space */
45 AVER(CHECKT(Pool, pool)); 45 AVER(TESTT(Pool, pool));
46 arena = PoolArena(pool); 46 arena = PoolArena(pool);
47 47
48 ArenaEnter(arena); 48 ArenaEnter(arena);
diff --git a/mps/code/eventpro.c b/mps/code/eventpro.c
index 5655d35171b..16cbf41d3c9 100644
--- a/mps/code/eventpro.c
+++ b/mps/code/eventpro.c
@@ -356,20 +356,20 @@ void EventDestroy(EventProc proc, Event event)
356 356
357/* Checking macros, copied from check.h */ 357/* Checking macros, copied from check.h */
358 358
359#define CHECKLVALUE(lv1, lv2) \ 359#define COMPATLVALUE(lv1, lv2) \
360 ((void)sizeof((lv1) = (lv2)), (void)sizeof((lv2) = (lv1)), TRUE) 360 ((void)sizeof((lv1) = (lv2)), (void)sizeof((lv2) = (lv1)), TRUE)
361 361
362#define CHECKTYPE(t1, t2) \ 362#define COMPATTYPE(t1, t2) \
363 (sizeof(t1) == sizeof(t2) && \ 363 (sizeof(t1) == sizeof(t2) && \
364 CHECKLVALUE(*((t1 *)0), *((t2 *)0))) 364 COMPATLVALUE(*((t1 *)0), *((t2 *)0)))
365 365
366#define CHECKFIELDAPPROX(s1, f1, s2, f2) \ 366#define COMPATFIELDAPPROX(s1, f1, s2, f2) \
367 (sizeof(((s1 *)0)->f1) == sizeof(((s2 *)0)->f2) && \ 367 (sizeof(((s1 *)0)->f1) == sizeof(((s2 *)0)->f2) && \
368 offsetof(s1, f1) == offsetof(s2, f2)) 368 offsetof(s1, f1) == offsetof(s2, f2))
369 369
370#define CHECKFIELD(s1, f1, s2, f2) \ 370#define COMPATFIELD(s1, f1, s2, f2) \
371 (CHECKFIELDAPPROX(s1, f1, s2, f2) && \ 371 (COMPATFIELDAPPROX(s1, f1, s2, f2) && \
372 CHECKLVALUE(((s1 *)0)->f1, ((s2 *)0)->f2)) 372 COMPATLVALUE(((s1 *)0)->f1, ((s2 *)0)->f2))
373 373
374 374
375/* EventProcCreate -- initialize the module */ 375/* EventProcCreate -- initialize the module */
@@ -383,8 +383,8 @@ Res EventProcCreate(EventProc *procReturn, Bool partial,
383 if (proc == NULL) return ResMEMORY; 383 if (proc == NULL) return ResMEMORY;
384 384
385 /* check event struct access */ 385 /* check event struct access */
386 assert(CHECKFIELD(EventUnion, any.code, EventWSStruct, code)); 386 assert(COMPATFIELD(EventUnion, any.code, EventWSStruct, code));
387 assert(CHECKFIELD(EventUnion, any.clock, EventWSStruct, clock)); 387 assert(COMPATFIELD(EventUnion, any.clock, EventWSStruct, clock));
388 /* check use of labelTable */ 388 /* check use of labelTable */
389#if !defined(MPS_OS_FR) 389#if !defined(MPS_OS_FR)
390 /* GCC -ansi -pedantic -Werror on FreeBSD will fail here 390 /* GCC -ansi -pedantic -Werror on FreeBSD will fail here
diff --git a/mps/code/eventrep.c b/mps/code/eventrep.c
index 7bbf2828eb2..75437f532b4 100644
--- a/mps/code/eventrep.c
+++ b/mps/code/eventrep.c
@@ -682,12 +682,12 @@ void EventReplay(Event event, Word etime)
682 682
683/* Checking macros, copied from check.h */ 683/* Checking macros, copied from check.h */
684 684
685#define CHECKLVALUE(lv1, lv2) \ 685#define COMPATLVALUE(lv1, lv2) \
686 ((void)sizeof((lv1) = (lv2)), (void)sizeof((lv2) = (lv1)), TRUE) 686 ((void)sizeof((lv1) = (lv2)), (void)sizeof((lv2) = (lv1)), TRUE)
687 687
688#define CHECKTYPE(t1, t2) \ 688#define COMPATTYPE(t1, t2) \
689 (sizeof(t1) == sizeof(t2) && \ 689 (sizeof(t1) == sizeof(t2) && \
690 CHECKLVALUE(*((t1 *)0), *((t2 *)0))) 690 COMPATLVALUE(*((t1 *)0), *((t2 *)0)))
691 691
692 692
693/* CHECKCONV -- check t2 can be cast to t1 without loss */ 693/* CHECKCONV -- check t2 can be cast to t1 without loss */
@@ -705,8 +705,8 @@ Res EventRepInit(Bool partial)
705 /* Check using pointers as keys in the tables. */ 705 /* Check using pointers as keys in the tables. */
706 verify(CHECKCONV(Word, void *)); 706 verify(CHECKCONV(Word, void *));
707 /* Check storage of MPS opaque handles in the tables. */ 707 /* Check storage of MPS opaque handles in the tables. */
708 verify(CHECKTYPE(mps_arena_t, void *)); 708 verify(COMPATTYPE(mps_arena_t, void *));
709 verify(CHECKTYPE(mps_ap_t, void *)); 709 verify(COMPATTYPE(mps_ap_t, void *));
710 /* .event-conv: Conversion of event fields into the types required */ 710 /* .event-conv: Conversion of event fields into the types required */
711 /* by the MPS functions is justified by the reverse conversion */ 711 /* by the MPS functions is justified by the reverse conversion */
712 /* being acceptable (which is upto the event log generator). */ 712 /* being acceptable (which is upto the event log generator). */
diff --git a/mps/code/global.c b/mps/code/global.c
index ede40309f4a..806da8dfbaa 100644
--- a/mps/code/global.c
+++ b/mps/code/global.c
@@ -484,7 +484,7 @@ void arenaEnterLock(Arena arena, int recursive)
484 /* This check is safe to do outside the lock. Unless the client 484 /* This check is safe to do outside the lock. Unless the client
485 is also calling ArenaDestroy, but that's a protocol violation by 485 is also calling ArenaDestroy, but that's a protocol violation by
486 the client if so. */ 486 the client if so. */
487 AVER(CHECKT(Arena, arena)); 487 AVER(TESTT(Arena, arena));
488 488
489 StackProbe(StackProbeDEPTH); 489 StackProbe(StackProbeDEPTH);
490 lock = ArenaGlobals(arena)->lock; 490 lock = ArenaGlobals(arena)->lock;
@@ -946,7 +946,7 @@ Res GlobalsDescribe(Globals arenaGlobals, mps_lib_FILE *stream)
946 Ring node, nextNode; 946 Ring node, nextNode;
947 Index i; 947 Index i;
948 948
949 if (!CHECKT(Globals, arenaGlobals)) return ResFAIL; 949 if (!TESTT(Globals, arenaGlobals)) return ResFAIL;
950 if (stream == NULL) return ResFAIL; 950 if (stream == NULL) return ResFAIL;
951 951
952 arena = GlobalsArena(arenaGlobals); 952 arena = GlobalsArena(arenaGlobals);
diff --git a/mps/code/mpsi.c b/mps/code/mpsi.c
index 3a356f5d50a..06b2e50cc15 100644
--- a/mps/code/mpsi.c
+++ b/mps/code/mpsi.c
@@ -73,7 +73,7 @@ static Bool mpsi_check(void)
73 /* .check.rc: Check that external and internal result codes match. */ 73 /* .check.rc: Check that external and internal result codes match. */
74 /* See <code/mps.h#result-codes> and <code/mpmtypes.h#result-codes>. */ 74 /* See <code/mps.h#result-codes> and <code/mpmtypes.h#result-codes>. */
75 /* Also see .check.enum.cast. */ 75 /* Also see .check.enum.cast. */
76 CHECKL(CHECKTYPE(mps_res_t, Res)); 76 CHECKL(COMPATTYPE(mps_res_t, Res));
77 CHECKL((int)MPS_RES_OK == (int)ResOK); 77 CHECKL((int)MPS_RES_OK == (int)ResOK);
78 CHECKL((int)MPS_RES_FAIL == (int)ResFAIL); 78 CHECKL((int)MPS_RES_FAIL == (int)ResFAIL);
79 CHECKL((int)MPS_RES_RESOURCE == (int)ResRESOURCE); 79 CHECKL((int)MPS_RES_RESOURCE == (int)ResRESOURCE);
@@ -86,7 +86,7 @@ static Bool mpsi_check(void)
86 /* Check that external and internal rank numbers match. */ 86 /* Check that external and internal rank numbers match. */
87 /* See <code/mps.h#ranks> and <code/mpmtypes.h#ranks>. */ 87 /* See <code/mps.h#ranks> and <code/mpmtypes.h#ranks>. */
88 /* Also see .check.enum.cast. */ 88 /* Also see .check.enum.cast. */
89 CHECKL(CHECKTYPE(mps_rank_t, Rank)); 89 CHECKL(COMPATTYPE(mps_rank_t, Rank));
90 CHECKL((int)MPS_RANK_AMBIG == (int)RankAMBIG); 90 CHECKL((int)MPS_RANK_AMBIG == (int)RankAMBIG);
91 CHECKL((int)MPS_RANK_EXACT == (int)RankEXACT); 91 CHECKL((int)MPS_RANK_EXACT == (int)RankEXACT);
92 CHECKL((int)MPS_RANK_WEAK == (int)RankWEAK); 92 CHECKL((int)MPS_RANK_WEAK == (int)RankWEAK);
@@ -95,7 +95,7 @@ static Bool mpsi_check(void)
95 /* See <code/mps.h#message.types> and */ 95 /* See <code/mps.h#message.types> and */
96 /* <code/mpmtypes.h#message.types>. */ 96 /* <code/mpmtypes.h#message.types>. */
97 /* Also see .check.enum.cast. */ 97 /* Also see .check.enum.cast. */
98 CHECKL(CHECKTYPE(mps_message_type_t, MessageType)); 98 CHECKL(COMPATTYPE(mps_message_type_t, MessageType));
99 CHECKL((int)MessageTypeFINALIZATION 99 CHECKL((int)MessageTypeFINALIZATION
100 == (int)MPS_MESSAGE_TYPE_FINALIZATION); 100 == (int)MPS_MESSAGE_TYPE_FINALIZATION);
101 CHECKL((int)MessageTypeGC 101 CHECKL((int)MessageTypeGC
@@ -106,74 +106,74 @@ static Bool mpsi_check(void)
106 /* The external idea of a word width and the internal one */ 106 /* The external idea of a word width and the internal one */
107 /* had better match. See <design/interface-c/#cons>. */ 107 /* had better match. See <design/interface-c/#cons>. */
108 CHECKL(sizeof(mps_word_t) == sizeof(void *)); 108 CHECKL(sizeof(mps_word_t) == sizeof(void *));
109 CHECKL(CHECKTYPE(mps_word_t, Word)); 109 CHECKL(COMPATTYPE(mps_word_t, Word));
110 110
111 /* The external idea of an address and the internal one */ 111 /* The external idea of an address and the internal one */
112 /* had better match. */ 112 /* had better match. */
113 CHECKL(CHECKTYPE(mps_addr_t, Addr)); 113 CHECKL(COMPATTYPE(mps_addr_t, Addr));
114 114
115 /* The external idea of size and the internal one had */ 115 /* The external idea of size and the internal one had */
116 /* better match. See <design/interface-c/#cons.size> */ 116 /* better match. See <design/interface-c/#cons.size> */
117 /* and <design/interface-c/#pun.size>. */ 117 /* and <design/interface-c/#pun.size>. */
118 CHECKL(CHECKTYPE(size_t, Size)); 118 CHECKL(COMPATTYPE(size_t, Size));
119 119
120 /* Clock values are passed from external to internal and back */ 120 /* Clock values are passed from external to internal and back */
121 /* out to external. */ 121 /* out to external. */
122 CHECKL(CHECKTYPE(mps_clock_t, Clock)); 122 CHECKL(COMPATTYPE(mps_clock_t, Clock));
123 123
124 /* Check ap_s/APStruct compatibility by hand */ 124 /* Check ap_s/APStruct compatibility by hand */
125 /* .check.ap: See <code/mps.h#ap> and <code/buffer.h#ap>. */ 125 /* .check.ap: See <code/mps.h#ap> and <code/buffer.h#ap>. */
126 CHECKL(sizeof(mps_ap_s) == sizeof(APStruct)); 126 CHECKL(sizeof(mps_ap_s) == sizeof(APStruct));
127 CHECKL(CHECKFIELD(mps_ap_s, init, APStruct, init)); 127 CHECKL(COMPATFIELD(mps_ap_s, init, APStruct, init));
128 CHECKL(CHECKFIELD(mps_ap_s, alloc, APStruct, alloc)); 128 CHECKL(COMPATFIELD(mps_ap_s, alloc, APStruct, alloc));
129 CHECKL(CHECKFIELD(mps_ap_s, limit, APStruct, limit)); 129 CHECKL(COMPATFIELD(mps_ap_s, limit, APStruct, limit));
130 130
131 /* Check sac_s/ExternalSACStruct compatibility by hand */ 131 /* Check sac_s/ExternalSACStruct compatibility by hand */
132 /* See <code/mps.h#sac> and <code/sac.h#sac>. */ 132 /* See <code/mps.h#sac> and <code/sac.h#sac>. */
133 CHECKL(sizeof(mps_sac_s) == sizeof(ExternalSACStruct)); 133 CHECKL(sizeof(mps_sac_s) == sizeof(ExternalSACStruct));
134 CHECKL(CHECKFIELD(mps_sac_s, mps_middle, ExternalSACStruct, middle)); 134 CHECKL(COMPATFIELD(mps_sac_s, mps_middle, ExternalSACStruct, middle));
135 CHECKL(CHECKFIELD(mps_sac_s, mps_trapped, 135 CHECKL(COMPATFIELD(mps_sac_s, mps_trapped,
136 ExternalSACStruct, trapped)); 136 ExternalSACStruct, trapped));
137 CHECKL(CHECKFIELDAPPROX(mps_sac_s, mps_freelists, 137 CHECKL(COMPATFIELDAPPROX(mps_sac_s, mps_freelists,
138 ExternalSACStruct, freelists)); 138 ExternalSACStruct, freelists));
139 CHECKL(sizeof(mps_sac_freelist_block_s) 139 CHECKL(sizeof(mps_sac_freelist_block_s)
140 == sizeof(SACFreeListBlockStruct)); 140 == sizeof(SACFreeListBlockStruct));
141 CHECKL(CHECKFIELD(mps_sac_freelist_block_s, mps_size, 141 CHECKL(COMPATFIELD(mps_sac_freelist_block_s, mps_size,
142 SACFreeListBlockStruct, size)); 142 SACFreeListBlockStruct, size));
143 CHECKL(CHECKFIELD(mps_sac_freelist_block_s, mps_count, 143 CHECKL(COMPATFIELD(mps_sac_freelist_block_s, mps_count,
144 SACFreeListBlockStruct, count)); 144 SACFreeListBlockStruct, count));
145 CHECKL(CHECKFIELD(mps_sac_freelist_block_s, mps_count_max, 145 CHECKL(COMPATFIELD(mps_sac_freelist_block_s, mps_count_max,
146 SACFreeListBlockStruct, countMax)); 146 SACFreeListBlockStruct, countMax));
147 CHECKL(CHECKFIELD(mps_sac_freelist_block_s, mps_blocks, 147 CHECKL(COMPATFIELD(mps_sac_freelist_block_s, mps_blocks,
148 SACFreeListBlockStruct, blocks)); 148 SACFreeListBlockStruct, blocks));
149 149
150 /* Check sac_classes_s/SACClassesStruct compatibility by hand */ 150 /* Check sac_classes_s/SACClassesStruct compatibility by hand */
151 /* See <code/mps.h#sacc> and <code/sac.h#sacc>. */ 151 /* See <code/mps.h#sacc> and <code/sac.h#sacc>. */
152 CHECKL(sizeof(mps_sac_classes_s) == sizeof(SACClassesStruct)); 152 CHECKL(sizeof(mps_sac_classes_s) == sizeof(SACClassesStruct));
153 CHECKL(CHECKFIELD(mps_sac_classes_s, mps_block_size, 153 CHECKL(COMPATFIELD(mps_sac_classes_s, mps_block_size,
154 SACClassesStruct, blockSize)); 154 SACClassesStruct, blockSize));
155 CHECKL(CHECKFIELD(mps_sac_classes_s, mps_cached_count, 155 CHECKL(COMPATFIELD(mps_sac_classes_s, mps_cached_count,
156 SACClassesStruct, cachedCount)); 156 SACClassesStruct, cachedCount));
157 CHECKL(CHECKFIELD(mps_sac_classes_s, mps_frequency, 157 CHECKL(COMPATFIELD(mps_sac_classes_s, mps_frequency,
158 SACClassesStruct, frequency)); 158 SACClassesStruct, frequency));
159 159
160 /* Check ss_s/ScanStateStruct compatibility by hand */ 160 /* Check ss_s/ScanStateStruct compatibility by hand */
161 /* .check.ss: See <code/mps.h#ss> and <code/mpmst.h#ss>. */ 161 /* .check.ss: See <code/mps.h#ss> and <code/mpmst.h#ss>. */
162 /* Note that the size of the mps_ss_s and ScanStateStruct */ 162 /* Note that the size of the mps_ss_s and ScanStateStruct */
163 /* are not equal. See <code/mpmst.h#ss>. CHECKFIELDAPPROX */ 163 /* are not equal. See <code/mpmst.h#ss>. COMPATFIELDAPPROX */
164 /* is used on the fix field because its type is punned and */ 164 /* is used on the fix field because its type is punned and */
165 /* therefore isn't exactly checkable. See */ 165 /* therefore isn't exactly checkable. See */
166 /* <design/interface-c/#pun.addr>. */ 166 /* <design/interface-c/#pun.addr>. */
167 CHECKL(CHECKFIELDAPPROX(mps_ss_s, fix, ScanStateStruct, fix)); 167 CHECKL(COMPATFIELDAPPROX(mps_ss_s, fix, ScanStateStruct, fix));
168 CHECKL(CHECKFIELD(mps_ss_s, w0, ScanStateStruct, zoneShift)); 168 CHECKL(COMPATFIELD(mps_ss_s, w0, ScanStateStruct, zoneShift));
169 CHECKL(CHECKFIELD(mps_ss_s, w1, ScanStateStruct, white)); 169 CHECKL(COMPATFIELD(mps_ss_s, w1, ScanStateStruct, white));
170 CHECKL(CHECKFIELD(mps_ss_s, w2, ScanStateStruct, unfixedSummary)); 170 CHECKL(COMPATFIELD(mps_ss_s, w2, ScanStateStruct, unfixedSummary));
171 171
172 /* Check ld_s/LDStruct compatibility by hand */ 172 /* Check ld_s/LDStruct compatibility by hand */
173 /* .check.ld: See also <code/mpmst.h#ld.struct> and <code/mps.h#ld> */ 173 /* .check.ld: See also <code/mpmst.h#ld.struct> and <code/mps.h#ld> */
174 CHECKL(sizeof(mps_ld_s) == sizeof(LDStruct)); 174 CHECKL(sizeof(mps_ld_s) == sizeof(LDStruct));
175 CHECKL(CHECKFIELD(mps_ld_s, w0, LDStruct, epoch)); 175 CHECKL(COMPATFIELD(mps_ld_s, w0, LDStruct, epoch));
176 CHECKL(CHECKFIELD(mps_ld_s, w1, LDStruct, rs)); 176 CHECKL(COMPATFIELD(mps_ld_s, w1, LDStruct, rs));
177 177
178 return TRUE; 178 return TRUE;
179} 179}
@@ -726,7 +726,7 @@ void mps_fmt_destroy(mps_fmt_t mps_fmt)
726 Format format = (Format)mps_fmt; 726 Format format = (Format)mps_fmt;
727 Arena arena; 727 Arena arena;
728 728
729 AVER(CHECKT(Format, format)); 729 AVER(TESTT(Format, format));
730 arena = FormatArena(format); 730 arena = FormatArena(format);
731 731
732 ArenaEnter(arena); 732 ArenaEnter(arena);
@@ -776,7 +776,7 @@ void mps_pool_destroy(mps_pool_t mps_pool)
776 Pool pool = (Pool)mps_pool; 776 Pool pool = (Pool)mps_pool;
777 Arena arena; 777 Arena arena;
778 778
779 AVER(CHECKT(Pool, pool)); 779 AVER(TESTT(Pool, pool));
780 arena = PoolArena(pool); 780 arena = PoolArena(pool);
781 781
782 ArenaEnter(arena); 782 ArenaEnter(arena);
@@ -794,7 +794,7 @@ mps_res_t mps_alloc(mps_addr_t *p_o, mps_pool_t mps_pool, size_t size, ...)
794 Addr p; 794 Addr p;
795 Res res; 795 Res res;
796 796
797 AVER(CHECKT(Pool, pool)); 797 AVER(TESTT(Pool, pool));
798 arena = PoolArena(pool); 798 arena = PoolArena(pool);
799 799
800 ArenaEnter(arena); 800 ArenaEnter(arena);
@@ -836,7 +836,7 @@ void mps_free(mps_pool_t mps_pool, mps_addr_t p, size_t size)
836 Pool pool = (Pool)mps_pool; 836 Pool pool = (Pool)mps_pool;
837 Arena arena; 837 Arena arena;
838 838
839 AVER(CHECKT(Pool, pool)); 839 AVER(TESTT(Pool, pool));
840 arena = PoolArena(pool); 840 arena = PoolArena(pool);
841 841
842 ArenaEnter(arena); 842 ArenaEnter(arena);
@@ -864,7 +864,7 @@ mps_res_t mps_ap_create(mps_ap_t *mps_ap_o, mps_pool_t mps_pool, ...)
864 va_list args; 864 va_list args;
865 865
866 AVER(mps_ap_o != NULL); 866 AVER(mps_ap_o != NULL);
867 AVER(CHECKT(Pool, pool)); 867 AVER(TESTT(Pool, pool));
868 arena = PoolArena(pool); 868 arena = PoolArena(pool);
869 869
870 ArenaEnter(arena); 870 ArenaEnter(arena);
@@ -897,7 +897,7 @@ mps_res_t mps_ap_create_v(mps_ap_t *mps_ap_o, mps_pool_t mps_pool,
897 Res res; 897 Res res;
898 898
899 AVER(mps_ap_o != NULL); 899 AVER(mps_ap_o != NULL);
900 AVER(CHECKT(Pool, pool)); 900 AVER(TESTT(Pool, pool));
901 arena = PoolArena(pool); 901 arena = PoolArena(pool);
902 902
903 ArenaEnter(arena); 903 ArenaEnter(arena);
@@ -921,7 +921,7 @@ void mps_ap_destroy(mps_ap_t mps_ap)
921 Arena arena; 921 Arena arena;
922 922
923 AVER(mps_ap != NULL); 923 AVER(mps_ap != NULL);
924 AVER(CHECKT(Buffer, buf)); 924 AVER(TESTT(Buffer, buf));
925 arena = BufferArena(buf); 925 arena = BufferArena(buf);
926 926
927 ArenaEnter(arena); 927 ArenaEnter(arena);
@@ -945,7 +945,7 @@ mps_res_t (mps_reserve)(mps_addr_t *p_o, mps_ap_t mps_ap, size_t size)
945 945
946 AVER(p_o != NULL); 946 AVER(p_o != NULL);
947 AVER(mps_ap != NULL); 947 AVER(mps_ap != NULL);
948 AVER(CHECKT(Buffer, BufferOfAP((AP)mps_ap))); 948 AVER(TESTT(Buffer, BufferOfAP((AP)mps_ap)));
949 AVER(mps_ap->init == mps_ap->alloc); 949 AVER(mps_ap->init == mps_ap->alloc);
950 AVER(size > 0); 950 AVER(size > 0);
951 951
@@ -964,7 +964,7 @@ mps_res_t mps_reserve_with_reservoir_permit(mps_addr_t *p_o,
964 AVER(p_o != NULL); 964 AVER(p_o != NULL);
965 AVER(size > 0); 965 AVER(size > 0);
966 AVER(mps_ap != NULL); 966 AVER(mps_ap != NULL);
967 AVER(CHECKT(Buffer, BufferOfAP((AP)mps_ap))); 967 AVER(TESTT(Buffer, BufferOfAP((AP)mps_ap)));
968 AVER(mps_ap->init == mps_ap->alloc); 968 AVER(mps_ap->init == mps_ap->alloc);
969 969
970 MPS_RESERVE_WITH_RESERVOIR_PERMIT_BLOCK(res, *p_o, mps_ap, size); 970 MPS_RESERVE_WITH_RESERVOIR_PERMIT_BLOCK(res, *p_o, mps_ap, size);
@@ -985,7 +985,7 @@ mps_res_t mps_reserve_with_reservoir_permit(mps_addr_t *p_o,
985mps_bool_t (mps_commit)(mps_ap_t mps_ap, mps_addr_t p, size_t size) 985mps_bool_t (mps_commit)(mps_ap_t mps_ap, mps_addr_t p, size_t size)
986{ 986{
987 AVER(mps_ap != NULL); 987 AVER(mps_ap != NULL);
988 AVER(CHECKT(Buffer, BufferOfAP((AP)mps_ap))); 988 AVER(TESTT(Buffer, BufferOfAP((AP)mps_ap)));
989 AVER(p != NULL); 989 AVER(p != NULL);
990 AVER(size > 0); 990 AVER(size > 0);
991 AVER(p == mps_ap->init); 991 AVER(p == mps_ap->init);
@@ -1027,7 +1027,7 @@ mps_res_t (mps_ap_frame_push)(mps_frame_t *frame_o, mps_ap_t mps_ap)
1027 AllocFrame frame; 1027 AllocFrame frame;
1028 Res res; 1028 Res res;
1029 1029
1030 AVER(CHECKT(Buffer, buf)); 1030 AVER(TESTT(Buffer, buf));
1031 arena = BufferArena(buf); 1031 arena = BufferArena(buf);
1032 1032
1033 ArenaEnter(arena); 1033 ArenaEnter(arena);
@@ -1070,7 +1070,7 @@ mps_res_t (mps_ap_frame_pop)(mps_ap_t mps_ap, mps_frame_t frame)
1070 Arena arena; 1070 Arena arena;
1071 Res res; 1071 Res res;
1072 1072
1073 AVER(CHECKT(Buffer, buf)); 1073 AVER(TESTT(Buffer, buf));
1074 arena = BufferArena(buf); 1074 arena = BufferArena(buf);
1075 1075
1076 ArenaEnter(arena); 1076 ArenaEnter(arena);
@@ -1097,7 +1097,7 @@ mps_res_t mps_ap_fill(mps_addr_t *p_o, mps_ap_t mps_ap, size_t size)
1097 Res res; 1097 Res res;
1098 1098
1099 AVER(mps_ap != NULL); 1099 AVER(mps_ap != NULL);
1100 AVER(CHECKT(Buffer, buf)); 1100 AVER(TESTT(Buffer, buf));
1101 arena = BufferArena(buf); 1101 arena = BufferArena(buf);
1102 1102
1103 ArenaEnter(arena); 1103 ArenaEnter(arena);
@@ -1128,7 +1128,7 @@ mps_res_t mps_ap_fill_with_reservoir_permit(mps_addr_t *p_o, mps_ap_t mps_ap,
1128 Res res; 1128 Res res;
1129 1129
1130 AVER(mps_ap != NULL); 1130 AVER(mps_ap != NULL);
1131 AVER(CHECKT(Buffer, buf)); 1131 AVER(TESTT(Buffer, buf));
1132 arena = BufferArena(buf); 1132 arena = BufferArena(buf);
1133 1133
1134 ArenaEnter(arena); 1134 ArenaEnter(arena);
@@ -1162,7 +1162,7 @@ mps_bool_t mps_ap_trip(mps_ap_t mps_ap, mps_addr_t p, size_t size)
1162 Bool b; 1162 Bool b;
1163 1163
1164 AVER(mps_ap != NULL); 1164 AVER(mps_ap != NULL);
1165 AVER(CHECKT(Buffer, buf)); 1165 AVER(TESTT(Buffer, buf));
1166 arena = BufferArena(buf); 1166 arena = BufferArena(buf);
1167 1167
1168 ArenaEnter(arena); 1168 ArenaEnter(arena);
@@ -1191,7 +1191,7 @@ mps_res_t mps_sac_create(mps_sac_t *mps_sac_o, mps_pool_t mps_pool,
1191 Res res; 1191 Res res;
1192 1192
1193 AVER(mps_sac_o != NULL); 1193 AVER(mps_sac_o != NULL);
1194 AVER(CHECKT(Pool, pool)); 1194 AVER(TESTT(Pool, pool));
1195 arena = PoolArena(pool); 1195 arena = PoolArena(pool);
1196 1196
1197 ArenaEnter(arena); 1197 ArenaEnter(arena);
@@ -1214,7 +1214,7 @@ void mps_sac_destroy(mps_sac_t mps_sac)
1214 SAC sac = SACOfExternalSAC((ExternalSAC)mps_sac); 1214 SAC sac = SACOfExternalSAC((ExternalSAC)mps_sac);
1215 Arena arena; 1215 Arena arena;
1216 1216
1217 AVER(CHECKT(SAC, sac)); 1217 AVER(TESTT(SAC, sac));
1218 arena = SACArena(sac); 1218 arena = SACArena(sac);
1219 1219
1220 ArenaEnter(arena); 1220 ArenaEnter(arena);
@@ -1232,7 +1232,7 @@ void mps_sac_flush(mps_sac_t mps_sac)
1232 SAC sac = SACOfExternalSAC((ExternalSAC)mps_sac); 1232 SAC sac = SACOfExternalSAC((ExternalSAC)mps_sac);
1233 Arena arena; 1233 Arena arena;
1234 1234
1235 AVER(CHECKT(SAC, sac)); 1235 AVER(TESTT(SAC, sac));
1236 arena = SACArena(sac); 1236 arena = SACArena(sac);
1237 1237
1238 ArenaEnter(arena); 1238 ArenaEnter(arena);
@@ -1254,7 +1254,7 @@ mps_res_t mps_sac_fill(mps_addr_t *p_o, mps_sac_t mps_sac, size_t size,
1254 Res res; 1254 Res res;
1255 1255
1256 AVER(p_o != NULL); 1256 AVER(p_o != NULL);
1257 AVER(CHECKT(SAC, sac)); 1257 AVER(TESTT(SAC, sac));
1258 arena = SACArena(sac); 1258 arena = SACArena(sac);
1259 1259
1260 ArenaEnter(arena); 1260 ArenaEnter(arena);
@@ -1276,7 +1276,7 @@ void mps_sac_empty(mps_sac_t mps_sac, mps_addr_t p, size_t size)
1276 SAC sac = SACOfExternalSAC((ExternalSAC)mps_sac); 1276 SAC sac = SACOfExternalSAC((ExternalSAC)mps_sac);
1277 Arena arena; 1277 Arena arena;
1278 1278
1279 AVER(CHECKT(SAC, sac)); 1279 AVER(TESTT(SAC, sac));
1280 arena = SACArena(sac); 1280 arena = SACArena(sac);
1281 1281
1282 ArenaEnter(arena); 1282 ArenaEnter(arena);
@@ -1295,7 +1295,7 @@ mps_res_t mps_sac_alloc(mps_addr_t *p_o, mps_sac_t mps_sac, size_t size,
1295 Res res; 1295 Res res;
1296 1296
1297 AVER(p_o != NULL); 1297 AVER(p_o != NULL);
1298 AVER(CHECKT(SAC, SACOfExternalSAC((ExternalSAC)mps_sac))); 1298 AVER(TESTT(SAC, SACOfExternalSAC((ExternalSAC)mps_sac)));
1299 AVER(size > 0); 1299 AVER(size > 0);
1300 1300
1301 MPS_SAC_ALLOC_FAST(res, *p_o, mps_sac, size, (has_reservoir_permit != 0)); 1301 MPS_SAC_ALLOC_FAST(res, *p_o, mps_sac, size, (has_reservoir_permit != 0));
@@ -1307,7 +1307,7 @@ mps_res_t mps_sac_alloc(mps_addr_t *p_o, mps_sac_t mps_sac, size_t size,
1307 1307
1308void mps_sac_free(mps_sac_t mps_sac, mps_addr_t p, size_t size) 1308void mps_sac_free(mps_sac_t mps_sac, mps_addr_t p, size_t size)
1309{ 1309{
1310 AVER(CHECKT(SAC, SACOfExternalSAC((ExternalSAC)mps_sac))); 1310 AVER(TESTT(SAC, SACOfExternalSAC((ExternalSAC)mps_sac)));
1311 /* Can't check p outside arena lock */ 1311 /* Can't check p outside arena lock */
1312 AVER(size > 0); 1312 AVER(size > 0);
1313 1313
@@ -1940,7 +1940,7 @@ mps_res_t mps_ap_alloc_pattern_begin(mps_ap_t mps_ap,
1940 1940
1941 AVER(mps_ap != NULL); 1941 AVER(mps_ap != NULL);
1942 buf = BufferOfAP((AP)mps_ap); 1942 buf = BufferOfAP((AP)mps_ap);
1943 AVER(CHECKT(Buffer, buf)); 1943 AVER(TESTT(Buffer, buf));
1944 1944
1945 arena = BufferArena(buf); 1945 arena = BufferArena(buf);
1946 ArenaEnter(arena); 1946 ArenaEnter(arena);
@@ -1961,7 +1961,7 @@ mps_res_t mps_ap_alloc_pattern_end(mps_ap_t mps_ap,
1961 1961
1962 AVER(mps_ap != NULL); 1962 AVER(mps_ap != NULL);
1963 buf = BufferOfAP((AP)mps_ap); 1963 buf = BufferOfAP((AP)mps_ap);
1964 AVER(CHECKT(Buffer, buf)); 1964 AVER(TESTT(Buffer, buf));
1965 UNUSED(alloc_pattern); /* .ramp.hack */ 1965 UNUSED(alloc_pattern); /* .ramp.hack */
1966 1966
1967 arena = BufferArena(buf); 1967 arena = BufferArena(buf);
@@ -1982,7 +1982,7 @@ mps_res_t mps_ap_alloc_pattern_reset(mps_ap_t mps_ap)
1982 1982
1983 AVER(mps_ap != NULL); 1983 AVER(mps_ap != NULL);
1984 buf = BufferOfAP((AP)mps_ap); 1984 buf = BufferOfAP((AP)mps_ap);
1985 AVER(CHECKT(Buffer, buf)); 1985 AVER(TESTT(Buffer, buf));
1986 1986
1987 arena = BufferArena(buf); 1987 arena = BufferArena(buf);
1988 ArenaEnter(arena); 1988 ArenaEnter(arena);
@@ -2074,7 +2074,7 @@ void mps_chain_destroy(mps_chain_t mps_chain)
2074 Arena arena; 2074 Arena arena;
2075 Chain chain = (Chain)mps_chain; 2075 Chain chain = (Chain)mps_chain;
2076 2076
2077 AVER(CHECKT(Chain, chain)); 2077 AVER(TESTT(Chain, chain));
2078 arena = chain->arena; 2078 arena = chain->arena;
2079 2079
2080 ArenaEnter(arena); 2080 ArenaEnter(arena);
diff --git a/mps/code/pool.c b/mps/code/pool.c
index e2578cf3497..802acf01d6a 100644
--- a/mps/code/pool.c
+++ b/mps/code/pool.c
@@ -515,7 +515,7 @@ Res PoolDescribe(Pool pool, mps_lib_FILE *stream)
515 Res res; 515 Res res;
516 Ring node, nextNode; 516 Ring node, nextNode;
517 517
518 if (!CHECKT(Pool, pool)) return ResFAIL; 518 if (!TESTT(Pool, pool)) return ResFAIL;
519 if (stream == NULL) return ResFAIL; 519 if (stream == NULL) return ResFAIL;
520 520
521 res = WriteF(stream, 521 res = WriteF(stream,
diff --git a/mps/code/poolamc.c b/mps/code/poolamc.c
index bea60caa03e..3698f328b90 100644
--- a/mps/code/poolamc.c
+++ b/mps/code/poolamc.c
@@ -258,12 +258,12 @@ static Res AMCSegDescribe(Seg seg, mps_lib_FILE *stream)
258 Size row; 258 Size row;
259 char abzSketch[5]; 259 char abzSketch[5];
260 260
261 if(!CHECKT(Seg, seg)) 261 if(!TESTT(Seg, seg))
262 return ResFAIL; 262 return ResFAIL;
263 if(stream == NULL) 263 if(stream == NULL)
264 return ResFAIL; 264 return ResFAIL;
265 amcseg = Seg2amcSeg(seg); 265 amcseg = Seg2amcSeg(seg);
266 if(!CHECKT(amcSeg, amcseg)) 266 if(!TESTT(amcSeg, amcseg))
267 return ResFAIL; 267 return ResFAIL;
268 268
269 /* Describe the superclass fields first via next-method call */ 269 /* Describe the superclass fields first via next-method call */
@@ -745,7 +745,7 @@ static Res amcGenDescribe(amcGen gen, mps_lib_FILE *stream)
745{ 745{
746 Res res; 746 Res res;
747 747
748 if(!CHECKT(amcGen, gen)) 748 if(!TESTT(amcGen, gen))
749 return ResFAIL; 749 return ResFAIL;
750 750
751 res = WriteF(stream, 751 res = WriteF(stream,
@@ -2330,10 +2330,10 @@ static Res AMCDescribe(Pool pool, mps_lib_FILE *stream)
2330 Ring node, nextNode; 2330 Ring node, nextNode;
2331 char *rampmode; 2331 char *rampmode;
2332 2332
2333 if(!CHECKT(Pool, pool)) 2333 if(!TESTT(Pool, pool))
2334 return ResFAIL; 2334 return ResFAIL;
2335 amc = Pool2AMC(pool); 2335 amc = Pool2AMC(pool);
2336 if(!CHECKT(AMC, amc)) 2336 if(!TESTT(AMC, amc))
2337 return ResFAIL; 2337 return ResFAIL;
2338 if(stream == NULL) 2338 if(stream == NULL)
2339 return ResFAIL; 2339 return ResFAIL;
@@ -2485,7 +2485,7 @@ void mps_amc_apply(mps_pool_t mps_pool,
2485 mps_amc_apply_closure_s closure_s; 2485 mps_amc_apply_closure_s closure_s;
2486 Arena arena; 2486 Arena arena;
2487 2487
2488 AVER(CHECKT(Pool, pool)); 2488 AVER(TESTT(Pool, pool));
2489 arena = PoolArena(pool); 2489 arena = PoolArena(pool);
2490 ArenaEnter(arena); 2490 ArenaEnter(arena);
2491 AVERT(Pool, pool); 2491 AVERT(Pool, pool);
diff --git a/mps/code/poolams.c b/mps/code/poolams.c
index 913195aab7c..4fbaba79b7d 100644
--- a/mps/code/poolams.c
+++ b/mps/code/poolams.c
@@ -524,10 +524,10 @@ static Res AMSSegDescribe(Seg seg, mps_lib_FILE *stream)
524 Buffer buffer; /* the segment's buffer, if it has one */ 524 Buffer buffer; /* the segment's buffer, if it has one */
525 Index i; 525 Index i;
526 526
527 if (!CHECKT(Seg, seg)) return ResFAIL; 527 if (!TESTT(Seg, seg)) return ResFAIL;
528 if (stream == NULL) return ResFAIL; 528 if (stream == NULL) return ResFAIL;
529 amsseg = Seg2AMSSeg(seg); 529 amsseg = Seg2AMSSeg(seg);
530 if (!CHECKT(AMSSeg, amsseg)) return ResFAIL; 530 if (!TESTT(AMSSeg, amsseg)) return ResFAIL;
531 531
532 /* Describe the superclass fields first via next-method call */ 532 /* Describe the superclass fields first via next-method call */
533 super = SEG_SUPERCLASS(AMSSegClass); 533 super = SEG_SUPERCLASS(AMSSegClass);
@@ -1366,7 +1366,7 @@ static Res AMSFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
1366 Format format; 1366 Format format;
1367 1367
1368 AVERT_CRITICAL(Pool, pool); 1368 AVERT_CRITICAL(Pool, pool);
1369 AVER_CRITICAL(CHECKT(AMS, Pool2AMS(pool))); 1369 AVER_CRITICAL(TESTT(AMS, Pool2AMS(pool)));
1370 AVERT_CRITICAL(ScanState, ss); 1370 AVERT_CRITICAL(ScanState, ss);
1371 AVERT_CRITICAL(Seg, seg); 1371 AVERT_CRITICAL(Seg, seg);
1372 AVER_CRITICAL(refIO != NULL); 1372 AVER_CRITICAL(refIO != NULL);
@@ -1591,9 +1591,9 @@ static Res AMSDescribe(Pool pool, mps_lib_FILE *stream)
1591 Ring node, nextNode; 1591 Ring node, nextNode;
1592 Res res; 1592 Res res;
1593 1593
1594 if (!CHECKT(Pool, pool)) return ResFAIL; 1594 if (!TESTT(Pool, pool)) return ResFAIL;
1595 ams = Pool2AMS(pool); 1595 ams = Pool2AMS(pool);
1596 if (!CHECKT(AMS, ams)) return ResFAIL; 1596 if (!TESTT(AMS, ams)) return ResFAIL;
1597 if (stream == NULL) return ResFAIL; 1597 if (stream == NULL) return ResFAIL;
1598 1598
1599 res = WriteF(stream, 1599 res = WriteF(stream,
diff --git a/mps/code/poolmrg.c b/mps/code/poolmrg.c
index 73ec8ac81f1..6abba410f72 100644
--- a/mps/code/poolmrg.c
+++ b/mps/code/poolmrg.c
@@ -792,9 +792,9 @@ static Res MRGDescribe(Pool pool, mps_lib_FILE *stream)
792 RefPart refPart; 792 RefPart refPart;
793 Res res; 793 Res res;
794 794
795 if (!CHECKT(Pool, pool)) return ResFAIL; 795 if (!TESTT(Pool, pool)) return ResFAIL;
796 mrg = Pool2MRG(pool); 796 mrg = Pool2MRG(pool);
797 if (!CHECKT(MRG, mrg)) return ResFAIL; 797 if (!TESTT(MRG, mrg)) return ResFAIL;
798 if (stream == NULL) return ResFAIL; 798 if (stream == NULL) return ResFAIL;
799 799
800 arena = PoolArena(pool); 800 arena = PoolArena(pool);
diff --git a/mps/code/poolmv.c b/mps/code/poolmv.c
index ae71bb40804..a7026276008 100644
--- a/mps/code/poolmv.c
+++ b/mps/code/poolmv.c
@@ -646,9 +646,9 @@ static Res MVDescribe(Pool pool, mps_lib_FILE *stream)
646 char c; 646 char c;
647 Ring spans, node = NULL, nextNode; /* gcc whinge stop */ 647 Ring spans, node = NULL, nextNode; /* gcc whinge stop */
648 648
649 if(!CHECKT(Pool, pool)) return ResFAIL; 649 if(!TESTT(Pool, pool)) return ResFAIL;
650 mv = Pool2MV(pool); 650 mv = Pool2MV(pool);
651 if(!CHECKT(MV, mv)) return ResFAIL; 651 if(!TESTT(MV, mv)) return ResFAIL;
652 if(stream == NULL) return ResFAIL; 652 if(stream == NULL) return ResFAIL;
653 653
654 res = WriteF(stream, 654 res = WriteF(stream,
diff --git a/mps/code/poolmv2.c b/mps/code/poolmv2.c
index 974112b7abe..b67b236d1b4 100644
--- a/mps/code/poolmv2.c
+++ b/mps/code/poolmv2.c
@@ -685,9 +685,9 @@ static Res MVTDescribe(Pool pool, mps_lib_FILE *stream)
685 Res res; 685 Res res;
686 MVT mvt; 686 MVT mvt;
687 687
688 if (!CHECKT(Pool, pool)) return ResFAIL; 688 if (!TESTT(Pool, pool)) return ResFAIL;
689 mvt = Pool2MVT(pool); 689 mvt = Pool2MVT(pool);
690 if (!CHECKT(MVT, mvt)) return ResFAIL; 690 if (!TESTT(MVT, mvt)) return ResFAIL;
691 if (stream == NULL) return ResFAIL; 691 if (stream == NULL) return ResFAIL;
692 692
693 res = WriteF(stream, 693 res = WriteF(stream,
diff --git a/mps/code/poolmvff.c b/mps/code/poolmvff.c
index f13c94893aa..1bbe1e85806 100644
--- a/mps/code/poolmvff.c
+++ b/mps/code/poolmvff.c
@@ -537,9 +537,9 @@ static Res MVFFDescribe(Pool pool, mps_lib_FILE *stream)
537 Res res; 537 Res res;
538 MVFF mvff; 538 MVFF mvff;
539 539
540 if (!CHECKT(Pool, pool)) return ResFAIL; 540 if (!TESTT(Pool, pool)) return ResFAIL;
541 mvff = Pool2MVFF(pool); 541 mvff = Pool2MVFF(pool);
542 if (!CHECKT(MVFF, mvff)) return ResFAIL; 542 if (!TESTT(MVFF, mvff)) return ResFAIL;
543 if (stream == NULL) return ResFAIL; 543 if (stream == NULL) return ResFAIL;
544 544
545 res = WriteF(stream, 545 res = WriteF(stream,
diff --git a/mps/code/root.c b/mps/code/root.c
index bd2dd21f5ea..e746d3c1b61 100644
--- a/mps/code/root.c
+++ b/mps/code/root.c
@@ -380,7 +380,7 @@ void RootDestroy(Root root)
380 380
381Arena RootArena(Root root) 381Arena RootArena(Root root)
382{ 382{
383 AVER(CHECKT(Root, root)); 383 AVER(TESTT(Root, root));
384 return root->arena; 384 return root->arena;
385} 385}
386 386
@@ -584,7 +584,7 @@ Res RootDescribe(Root root, mps_lib_FILE *stream)
584{ 584{
585 Res res; 585 Res res;
586 586
587 if (!CHECKT(Root, root)) return ResFAIL; 587 if (!TESTT(Root, root)) return ResFAIL;
588 if (stream == NULL) return ResFAIL; 588 if (stream == NULL) return ResFAIL;
589 589
590 res = WriteF(stream, 590 res = WriteF(stream,
diff --git a/mps/code/seg.c b/mps/code/seg.c
index 3f95ba4ec88..6c194881bb8 100644
--- a/mps/code/seg.c
+++ b/mps/code/seg.c
@@ -353,7 +353,7 @@ Res SegDescribe(Seg seg, mps_lib_FILE *stream)
353 Res res; 353 Res res;
354 Pool pool; 354 Pool pool;
355 355
356 if (!CHECKT(Seg, seg)) return ResFAIL; 356 if (!TESTT(Seg, seg)) return ResFAIL;
357 if (stream == NULL) return ResFAIL; 357 if (stream == NULL) return ResFAIL;
358 358
359 pool = SegPool(seg); 359 pool = SegPool(seg);
@@ -964,7 +964,7 @@ static Res segTrivDescribe(Seg seg, mps_lib_FILE *stream)
964{ 964{
965 Res res; 965 Res res;
966 966
967 if (!CHECKT(Seg, seg)) return ResFAIL; 967 if (!TESTT(Seg, seg)) return ResFAIL;
968 if (stream == NULL) return ResFAIL; 968 if (stream == NULL) return ResFAIL;
969 969
970 res = WriteF(stream, 970 res = WriteF(stream,
@@ -1550,10 +1550,10 @@ static Res gcSegDescribe(Seg seg, mps_lib_FILE *stream)
1550 SegClass super; 1550 SegClass super;
1551 GCSeg gcseg; 1551 GCSeg gcseg;
1552 1552
1553 if (!CHECKT(Seg, seg)) return ResFAIL; 1553 if (!TESTT(Seg, seg)) return ResFAIL;
1554 if (stream == NULL) return ResFAIL; 1554 if (stream == NULL) return ResFAIL;
1555 gcseg = SegGCSeg(seg); 1555 gcseg = SegGCSeg(seg);
1556 if (!CHECKT(GCSeg, gcseg)) return ResFAIL; 1556 if (!TESTT(GCSeg, gcseg)) return ResFAIL;
1557 1557
1558 /* Describe the superclass fields first via next-method call */ 1558 /* Describe the superclass fields first via next-method call */
1559 super = SEG_SUPERCLASS(GCSegClass); 1559 super = SEG_SUPERCLASS(GCSegClass);
diff --git a/mps/code/vmw3.c b/mps/code/vmw3.c
index 554209687d3..e1e05b4ab2a 100644
--- a/mps/code/vmw3.c
+++ b/mps/code/vmw3.c
@@ -103,8 +103,8 @@ Res VMCreate(VM *vmReturn, Size size)
103 103
104 AVER(vmReturn != NULL); 104 AVER(vmReturn != NULL);
105 105
106 AVER(CHECKTYPE(LPVOID, Addr)); /* .assume.lpvoid-addr */ 106 AVER(COMPATTYPE(LPVOID, Addr)); /* .assume.lpvoid-addr */
107 AVER(CHECKTYPE(SIZE_T, Size)); 107 AVER(COMPATTYPE(SIZE_T, Size));
108 108
109 GetSystemInfo(&si); 109 GetSystemInfo(&si);
110 align = (Align)si.dwPageSize; 110 align = (Align)si.dwPageSize;