aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code/amcss.c
diff options
context:
space:
mode:
authorNick Barnes2001-11-23 15:26:23 +0000
committerNick Barnes2001-11-23 15:26:23 +0000
commiteef2f4743c288d2b2e7846129430949186b21d98 (patch)
tree3b7545d340d4032e78411c1901eeb0b87d556e09 /mps/code/amcss.c
parent04fe0477bb432d4f76f6f4d4b244286e19105978 (diff)
parent35651f3b1d1ee333d72fabd7606723bed87c40ef (diff)
downloademacs-eef2f4743c288d2b2e7846129430949186b21d98.tar.gz
emacs-eef2f4743c288d2b2e7846129430949186b21d98.zip
Merging mps_arena_has_addr() stuff from configura branch to master sources.
Copied from Perforce Change: 24163 ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code/amcss.c')
-rw-r--r--mps/code/amcss.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/mps/code/amcss.c b/mps/code/amcss.c
index 454c4c777ad..32278402d74 100644
--- a/mps/code/amcss.c
+++ b/mps/code/amcss.c
@@ -50,7 +50,7 @@ static void enable(mps_arena_t arena)
50static void report(mps_arena_t arena) 50static void report(mps_arena_t arena)
51{ 51{
52 mps_message_t message; 52 mps_message_t message;
53 53
54 while (mps_message_get(&message, arena, mps_message_type_gc())) { 54 while (mps_message_get(&message, arena, mps_message_type_gc())) {
55 size_t live, condemned, not_condemned; 55 size_t live, condemned, not_condemned;
56 56
@@ -156,10 +156,23 @@ static void *test(void *arg, size_t s)
156 collections = c; 156 collections = c;
157 printf("\nCollection %lu, %lu objects.\n", 157 printf("\nCollection %lu, %lu objects.\n",
158 c, objs); 158 c, objs);
159 do {
160 mps_addr_t p = (mps_addr_t)rnd();
161 if (mps_arena_has_addr(arena, p)) {
162 printf("0x%08x is in arena\n", (int)p);
163 break;
164 }
165 } while(1);
166
159 report(arena); 167 report(arena);
160 for(r = 0; r < exactRootsCOUNT; ++r) 168 for(r = 0; r < exactRootsCOUNT; ++r)
161 cdie(exactRoots[r] == objNULL || dylan_check(exactRoots[r]), 169 cdie(exactRoots[r] == objNULL ||
170 (dylan_check(exactRoots[r]) &&
171 mps_arena_has_addr(arena, exactRoots[r])),
162 "all roots check"); 172 "all roots check");
173 cdie(!mps_arena_has_addr(arena, NULL),
174 "NULL in arena");
175
163 if(collections == collectionsCOUNT / 2) { 176 if(collections == collectionsCOUNT / 2) {
164 unsigned long object_count = 0; 177 unsigned long object_count = 0;
165 mps_arena_park(arena); 178 mps_arena_park(arena);