Changeset 517
- Timestamp:
- 01/18/11 06:56:14 (14 years ago)
- Files:
-
- trunk/src/gc/gcx.d (modified) (23 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/gc/gcx.d
r496 r517 103 103 struct Log 104 104 { 105 105 void* p; 106 106 size_t size; 107 107 size_t line; 108 108 char* file; 109 109 void* parent; 110 110 111 111 void print() 112 112 { 113 printf(" p = % x, size = %d, parent = %x", p, size, parent);113 printf(" p = %p, size = %zd, parent = %p ", p, size, parent); 114 114 if (file) 115 115 { 116 116 printf("%s(%u)", file, line); 117 117 } 118 118 printf("\n"); 119 119 } 120 120 } 121 121 122 122 123 123 struct LogArray … … 483 483 default: 484 484 assert(false); 485 485 } 486 486 } 487 487 p = gcx.bucket[bin]; 488 488 489 489 // Return next item from free list 490 490 gcx.bucket[bin] = (cast(List*)p).next; 491 491 if( !(bits & BlkAttr.NO_SCAN) ) 492 492 memset(p + size, 0, binsize[bin] - size); 493 //debug(PRINTF) printf("\tmalloc => % x\n", p);493 //debug(PRINTF) printf("\tmalloc => %p\n", p); 494 494 debug (MEMSTOMP) memset(p, 0xF0, size); 495 495 } 496 496 else 497 497 { 498 498 p = gcx.bigAlloc(size, alloc_size); 499 499 if (!p) 500 500 onOutOfMemoryError(); 501 501 } 502 502 size -= SENTINEL_EXTRA; 503 503 p = sentinel_add(p); … … 537 537 } 538 538 539 539 540 540 // 541 541 // 542 542 // 543 543 private void *callocNoSync(size_t size, uint bits = 0, size_t *alloc_size = null) 544 544 { 545 545 assert(size != 0); 546 546 547 //debug(PRINTF) printf("calloc: % xlen %d\n", p, len);547 //debug(PRINTF) printf("calloc: %p len %d\n", p, len); 548 548 void *p = mallocNoSync(size, bits, alloc_size); 549 549 memset(p, 0, size); 550 550 return p; 551 551 } 552 552 553 553 554 554 /** 555 555 * 556 556 */ 557 557 void *realloc(void *p, size_t size, uint bits = 0, size_t *alloc_size = null) … … 580 580 *alloc_size = 0; 581 581 } 582 582 else if (!p) 583 583 { 584 584 p = mallocNoSync(size, bits, alloc_size); 585 585 } 586 586 else 587 587 { void *p2; 588 588 size_t psize; 589 589 590 //debug(PRINTF) printf("GC::realloc(p = % x, size = %u)\n", p, size);590 //debug(PRINTF) printf("GC::realloc(p = %p, size = %zu)\n", p, size); 591 591 version (SENTINEL) 592 592 { 593 593 sentinel_Invariant(p); 594 594 psize = *sentinel_size(p); 595 595 if (psize != size) 596 596 { 597 597 if (psize) 598 598 { 599 599 Pool *pool = gcx.findPool(p); 600 600 … … 737 737 // 738 738 // 739 739 // 740 740 private size_t extendNoSync(void* p, size_t minsize, size_t maxsize) 741 741 in 742 742 { 743 743 assert( minsize <= maxsize ); 744 744 } 745 745 body 746 746 { 747 //debug(PRINTF) printf("GC::extend(p = % x, minsize = %u, maxsize = %u)\n", p, minsize, maxsize);747 //debug(PRINTF) printf("GC::extend(p = %p, minsize = %zu, maxsize = %zu)\n", p, minsize, maxsize); 748 748 version (SENTINEL) 749 749 { 750 750 return 0; 751 751 } 752 752 auto psize = gcx.findSize(p); // find allocated size 753 753 if (psize < PAGESIZE) 754 754 return 0; // cannot extend buckets 755 755 756 756 auto psz = psize / PAGESIZE; 757 757 auto minsz = (minsize + PAGESIZE - 1) / PAGESIZE; … … 1098 1098 // 1099 1099 // 1100 1100 // 1101 1101 private void setStackBottom(void *p) 1102 1102 { 1103 1103 version (STACKGROWSDOWN) 1104 1104 { 1105 1105 //p = (void *)((uint *)p + 4); 1106 1106 if (p > gcx.stackBottom) 1107 1107 { 1108 //debug(PRINTF) printf("setStackBottom(% x)\n", p);1108 //debug(PRINTF) printf("setStackBottom(%p)\n", p); 1109 1109 gcx.stackBottom = p; 1110 1110 } 1111 1111 } 1112 1112 else 1113 1113 { 1114 1114 //p = (void *)((uint *)p - 4); 1115 1115 if (p < gcx.stackBottom) 1116 1116 { 1117 //debug(PRINTF) printf("setStackBottom(% x)\n", p);1117 //debug(PRINTF) printf("setStackBottom(%p)\n", p); 1118 1118 gcx.stackBottom = cast(char*)p; 1119 1119 } 1120 1120 } 1121 1121 } 1122 1122 1123 1123 1124 1124 /** 1125 1125 * add p to list of roots 1126 1126 */ 1127 1127 void addRoot(void *p) … … 1182 1182 /** 1183 1183 * add range to scan for roots 1184 1184 */ 1185 1185 void addRange(void *p, size_t sz) 1186 1186 { 1187 1187 if (!p || !sz) 1188 1188 { 1189 1189 return; 1190 1190 } 1191 1191 1192 //debug(PRINTF) printf("+GC.addRange(p bot = x%x, ptop = x%x)\n", pbot, ptop);1192 //debug(PRINTF) printf("+GC.addRange(p = %p, sz = 0x%zx), p + sz = %p\n", p, sz, p + sz); 1193 1193 if (!thread_needLock()) 1194 1194 { 1195 1195 gcx.addRange(p, p + sz); 1196 1196 } 1197 1197 else synchronized (gcLock) 1198 1198 { 1199 1199 gcx.addRange(p, p + sz); 1200 1200 } 1201 1201 //debug(PRINTF) printf("-GC.addRange()\n"); 1202 1202 } … … 1253 1253 synchronized (gcLock) 1254 1254 { 1255 1255 result = gcx.fullcollectshell(); 1256 1256 } 1257 1257 1258 1258 version (none) 1259 1259 { 1260 1260 GCStats stats; 1261 1261 1262 1262 getStats(stats); 1263 debug(PRINTF) printf("poolsize = % x, usedsize = %x, freelistsize = %x\n",1263 debug(PRINTF) printf("poolsize = %zx, usedsize = %zx, freelistsize = %zx\n", 1264 1264 stats.poolsize, stats.usedsize, stats.freelistsize); 1265 1265 } 1266 1266 1267 1267 gcx.log_collect(); 1268 1268 return result; 1269 1269 } 1270 1270 1271 1271 /** 1272 1272 * Returns true if the pointer is being collected. Should only be called 1273 1273 * with the base pointer of the block. … … 1359 1359 else if (bin < B_PAGE) 1360 1360 bsize += PAGESIZE; 1361 1361 } 1362 1362 } 1363 1363 1364 1364 for (n = 0; n < B_PAGE; n++) 1365 1365 { 1366 1366 //debug(PRINTF) printf("bin %d\n", n); 1367 1367 for (List *list = gcx.bucket[n]; list; list = list.next) 1368 1368 { 1369 //debug(PRINTF) printf("\tlist % x\n", list);1369 //debug(PRINTF) printf("\tlist %p\n", list); 1370 1370 flsize += binsize[n]; 1371 1371 } 1372 1372 } 1373 1373 1374 1374 usize = bsize - flsize; 1375 1375 1376 1376 stats.poolsize = psize; 1377 1377 stats.usedsize = bsize - flsize; 1378 1378 stats.freelistsize = flsize; 1379 1379 } … … 1431 1431 1432 1432 1433 1433 struct Gcx 1434 1434 { 1435 1435 debug (THREADINVARIANT) 1436 1436 { 1437 1437 pthread_t self; 1438 1438 void thread_Invariant() 1439 1439 { 1440 1440 if (self != pthread_self()) 1441 printf("thread_Invariant(): gcx = % x, self = %x, pthread_self() = %x\n",this, self, pthread_self());1441 printf("thread_Invariant(): gcx = %p, self = %x, pthread_self() = %x\n", &this, self, pthread_self()); 1442 1442 assert(self == pthread_self()); 1443 1443 } 1444 1444 } 1445 1445 else 1446 1446 { 1447 1447 void thread_Invariant() { } 1448 1448 } 1449 1449 1450 1450 void *cached_size_key; 1451 1451 size_t cached_size_val; … … 1478 1478 1479 1479 1480 1480 void initialize() 1481 1481 { int dummy; 1482 1482 1483 1483 (cast(byte*)&this)[0 .. Gcx.sizeof] = 0; 1484 1484 stackBottom = cast(char*)&dummy; 1485 1485 log_init(); 1486 1486 debug (THREADINVARIANT) 1487 1487 self = pthread_self(); 1488 //printf("gcx = %p, self = %x\n", this, self);1488 //printf("gcx = %p, self = %x\n", &this, self); 1489 1489 inited = 1; 1490 1490 } 1491 1491 1492 1492 1493 1493 void Dtor() 1494 1494 { 1495 1495 inited = 0; 1496 1496 1497 1497 for (size_t i = 0; i < npools; i++) 1498 1498 { Pool *pool = pooltable[i]; … … 1511 1511 } 1512 1512 1513 1513 1514 1514 void Invariant() { } 1515 1515 1516 1516 1517 1517 invariant() 1518 1518 { 1519 1519 if (inited) 1520 1520 { 1521 //printf("Gcx.invariant(): this = %p\n",this);1521 //printf("Gcx.invariant(): this = %p\n", &this); 1522 1522 size_t i; 1523 1523 1524 1524 // Assure we're called on the right thread 1525 1525 debug (THREADINVARIANT) assert(self == pthread_self()); 1526 1526 1527 1527 for (i = 0; i < npools; i++) 1528 1528 { Pool *pool = pooltable[i]; 1529 1529 1530 1530 pool.Invariant(); 1531 1531 if (i == 0) … … 1629 1629 return result; 1630 1630 } 1631 1631 1632 1632 1633 1633 /** 1634 1634 * 1635 1635 */ 1636 1636 void addRange(void *pbot, void *ptop) 1637 1637 { 1638 1638 //debug(PRINTF) printf("Thread %x ", pthread_self()); 1639 debug(PRINTF) printf("% x.Gcx::addRange(%x, %x), nranges = %d\n",this, pbot, ptop, nranges);1639 debug(PRINTF) printf("%p.Gcx::addRange(%p, %p), nranges = %d\n", &this, pbot, ptop, nranges); 1640 1640 if (nranges == rangedim) 1641 1641 { 1642 1642 size_t newdim = rangedim * 2 + 16; 1643 1643 Range *newranges; 1644 1644 1645 1645 newranges = cast(Range*)cstdlib.malloc(newdim * newranges[0].sizeof); 1646 1646 if (!newranges) 1647 1647 onOutOfMemoryError(); 1648 1648 if (ranges) 1649 1649 { memcpy(newranges, ranges, nranges * newranges[0].sizeof); … … 1657 1657 nranges++; 1658 1658 } 1659 1659 1660 1660 1661 1661 /** 1662 1662 * 1663 1663 */ 1664 1664 void removeRange(void *pbot) 1665 1665 { 1666 1666 //debug(PRINTF) printf("Thread %x ", pthread_self()); 1667 debug(PRINTF) printf(" %x.Gcx.removeRange(%x), nranges = %d\n", this, pbot, nranges);1667 debug(PRINTF) printf("Gcx.removeRange(%p), nranges = %d\n", pbot, nranges); 1668 1668 for (size_t i = nranges; i--;) 1669 1669 { 1670 1670 if (ranges[i].pbot == pbot) 1671 1671 { 1672 1672 nranges--; 1673 1673 memmove(ranges + i, ranges + i + 1, (nranges - i) * ranges[0].sizeof); 1674 1674 return; 1675 1675 } 1676 1676 } 1677 1677 debug(PRINTF) printf("Wrong thread\n"); … … 2058 2058 2059 2059 L1: 2060 2060 pool.pagetable[pn] = B_PAGE; 2061 2061 if (npages > 1) 2062 2062 memset(&pool.pagetable[pn + 1], B_PAGEPLUS, npages - 1); 2063 2063 p = pool.baseAddr + pn * PAGESIZE; 2064 2064 memset(cast(char *)p + size, 0, npages * PAGESIZE - size); 2065 2065 debug (MEMSTOMP) memset(p, 0xF1, size); 2066 2066 if(alloc_size) 2067 2067 *alloc_size = npages * PAGESIZE; 2068 //debug(PRINTF) printf("\tp = % x\n", p);2068 //debug(PRINTF) printf("\tp = %p\n", p); 2069 2069 return p; 2070 2070 2071 2071 Lnomemory: 2072 2072 return null; // let caller handle the error 2073 2073 } 2074 2074 2075 2075 2076 2076 /** 2077 2077 * Allocate a new pool with at least npages in it. 2078 2078 * Sort it into pooltable[]. … … 2201 2201 void **p1 = cast(void **)pbot; 2202 2202 void **p2 = cast(void **)ptop; 2203 2203 size_t pcache = 0; 2204 2204 uint changes = 0; 2205 2205 2206 2206 //printf("marking range: %p -> %p\n", pbot, ptop); 2207 2207 for (; p1 < p2; p1++) 2208 2208 { 2209 2209 auto p = cast(byte *)(*p1); 2210 2210 2211 //if (log) debug(PRINTF) printf("\tmark % x\n", p);2211 //if (log) debug(PRINTF) printf("\tmark %p\n", p); 2212 2212 if (p >= minAddr && p < maxAddr) 2213 2213 { 2214 2214 if ((cast(size_t)p & ~(PAGESIZE-1)) == pcache) 2215 2215 continue; 2216 2216 2217 2217 auto pool = findPool(p); 2218 2218 if (pool) 2219 2219 { 2220 2220 size_t offset = cast(size_t)(p - pool.baseAddr); 2221 2221 size_t biti = void; 2222 2222 size_t pn = offset / PAGESIZE; 2223 2223 Bins bin = cast(Bins)pool.pagetable[pn]; 2224 2224 2225 //debug(PRINTF) printf("\t\tfound pool % x, base=%x, pn = %d, bin = %d, biti = x%x\n", pool, pool.baseAddr, pn, bin, biti);2225 //debug(PRINTF) printf("\t\tfound pool %p, base=%p, pn = %zd, bin = %d, biti = x%x\n", pool, pool.baseAddr, pn, bin, biti); 2226 2226 2227 2227 // Adjust bit to be at start of allocated memory block 2228 2228 if (bin < B_PAGE) 2229 2229 { 2230 2230 biti = (offset & notbinsize[bin]) >> 4; 2231 2231 //debug(PRINTF) printf("\t\tbiti = x%x\n", biti); 2232 2232 } 2233 2233 else if (bin == B_PAGE) 2234 2234 { 2235 2235 biti = (offset & notbinsize[bin]) >> 4; … … 2248 2248 } 2249 2249 else 2250 2250 { 2251 2251 // Don't mark bits in B_FREE or B_UNCOMMITTED pages 2252 2252 continue; 2253 2253 } 2254 2254 2255 2255 //debug(PRINTF) printf("\t\tmark(x%x) = %d\n", biti, pool.mark.test(biti)); 2256 2256 if (!pool.mark.testSet(biti)) 2257 2257 { 2258 //if (log) debug(PRINTF) printf("\t\tmarking % x\n", p);2258 //if (log) debug(PRINTF) printf("\t\tmarking %p\n", p); 2259 2259 if (!pool.noscan.test(biti)) 2260 2260 { 2261 2261 pool.scan.set(biti); 2262 2262 changes = 1; 2263 2263 } 2264 2264 debug (LOGGING) log_parent(sentinel_add(pool.baseAddr + biti * 16), sentinel_add(pbot)); 2265 2265 } 2266 2266 } 2267 2267 } 2268 2268 } … … 2412 2412 { 2413 2413 // Scan stacks and registers for each paused thread 2414 2414 thread_scanAll( &mark, stackTop ); 2415 2415 } 2416 2416 } 2417 2417 else 2418 2418 { 2419 2419 if (!noStack) 2420 2420 { 2421 2421 // Scan stack for main thread 2422 debug(PRINTF) printf(" scan stack bot = % x, top = %x\n", stackTop, stackBottom);2422 debug(PRINTF) printf(" scan stack bot = %p, top = %p\n", stackTop, stackBottom); 2423 2423 version (STACKGROWSDOWN) 2424 2424 mark(stackTop, stackBottom); 2425 2425 else 2426 2426 mark(stackBottom, stackTop); 2427 2427 } 2428 2428 } 2429 2429 2430 2430 // Scan roots[] 2431 2431 debug(COLLECT_PRINTF) printf("\tscan roots[]\n"); 2432 2432 mark(roots, roots + nroots); 2433 2433 2434 2434 // Scan ranges[] 2435 2435 debug(COLLECT_PRINTF) printf("\tscan ranges[]\n"); 2436 2436 //log++; 2437 2437 for (n = 0; n < nranges; n++) 2438 2438 { 2439 debug(COLLECT_PRINTF) printf("\t\t% x .. %x\n", ranges[n].pbot, ranges[n].ptop);2439 debug(COLLECT_PRINTF) printf("\t\t%p .. %p\n", ranges[n].pbot, ranges[n].ptop); 2440 2440 mark(ranges[n].pbot, ranges[n].ptop); 2441 2441 } 2442 2442 //log--; 2443 2443 2444 2444 debug(COLLECT_PRINTF) printf("\tscan heap\n"); 2445 2445 while (anychanges) 2446 2446 { 2447 2447 debug(COLLECT_PRINTF) printf("\t\tpass\n"); 2448 2448 anychanges = 0; 2449 2449 for (n = 0; n < npools; n++) … … 2535 2535 if (bbase[0] == 0 && bbase[1] == 0 && bbase[2] == 0 && bbase[3] == 0 && 2536 2536 bbase[4] == 0 && bbase[5] == 0 && bbase[6] == 0 && bbase[7] == 0) 2537 2537 { 2538 2538 for (; p < ptop; p += size, biti += bitstride) 2539 2539 { 2540 2540 if (pool.finals.nbits && pool.finals.testClear(biti)) 2541 2541 rt_finalize(cast(List *)sentinel_add(p), false/*noStack > 0*/); 2542 2542 gcx.clrBits(pool, biti, BlkAttr.ALL_BITS); 2543 2543 2544 2544 List *list = cast(List *)p; 2545 //debug(PRINTF) printf("\tcollecting % x\n", list);2545 //debug(PRINTF) printf("\tcollecting %p\n", list); 2546 2546 log_free(sentinel_add(list)); 2547 2547 2548 2548 debug (MEMSTOMP) memset(p, 0xF3, size); 2549 2549 } 2550 2550 pool.pagetable[pn] = B_FREE; 2551 2551 freed += PAGESIZE; 2552 2552 //debug(PRINTF) printf("freeing entire page %d\n", pn); 2553 2553 continue; 2554 2554 } 2555 2555 } … … 2558 2558 if (!pool.mark.test(biti)) 2559 2559 { 2560 2560 sentinel_Invariant(sentinel_add(p)); 2561 2561 2562 2562 pool.freebits.set(biti); 2563 2563 if (pool.finals.nbits && pool.finals.testClear(biti)) 2564 2564 rt_finalize(cast(List *)sentinel_add(p), false/*noStack > 0*/); 2565 2565 clrBits(pool, biti, BlkAttr.ALL_BITS); 2566 2566 2567 2567 List *list = cast(List *)p; 2568 debug(PRINTF) printf("\tcollecting % x\n", list);2568 debug(PRINTF) printf("\tcollecting %p\n", list); 2569 2569 log_free(sentinel_add(list)); 2570 2570 2571 2571 debug (MEMSTOMP) memset(p, 0xF3, size); 2572 2572 2573 2573 freed += size; 2574 2574 } 2575 2575 } 2576 2576 } 2577 2577 else if (bin == B_PAGE) 2578 2578 { size_t biti = pn * (PAGESIZE / 16); 2579 2579 2580 2580 if (!pool.mark.test(biti)) 2581 2581 { byte *p = pool.baseAddr + pn * PAGESIZE; 2582 2582 2583 2583 sentinel_Invariant(sentinel_add(p)); 2584 2584 if (pool.finals.nbits && pool.finals.testClear(biti)) 2585 2585 rt_finalize(sentinel_add(p), false/*noStack > 0*/); 2586 2586 clrBits(pool, biti, BlkAttr.ALL_BITS); 2587 2587 2588 debug(COLLECT_PRINTF) printf("\tcollecting big % x\n", p);2588 debug(COLLECT_PRINTF) printf("\tcollecting big %p\n", p); 2589 2589 log_free(sentinel_add(p)); 2590 2590 pool.pagetable[pn] = B_FREE; 2591 2591 freedpages++; 2592 2592 debug (MEMSTOMP) memset(p, 0xF3, PAGESIZE); 2593 2593 while (pn + 1 < ncommitted && pool.pagetable[pn + 1] == B_PAGEPLUS) 2594 2594 { 2595 2595 pn++; 2596 2596 pool.pagetable[pn] = B_FREE; 2597 2597 freedpages++; 2598 2598 … … 2785 2785 { 2786 2786 //debug(PRINTF) printf("+log_init()\n"); 2787 2787 current.reserve(1000); 2788 2788 prev.reserve(1000); 2789 2789 //debug(PRINTF) printf("-log_init()\n"); 2790 2790 } 2791 2791 2792 2792 2793 2793 void log_malloc(void *p, size_t size) 2794 2794 { 2795 //debug(PRINTF) printf("+log_malloc(p = % x, size = %d)\n", p, size);2795 //debug(PRINTF) printf("+log_malloc(p = %p, size = %zd)\n", p, size); 2796 2796 Log log; 2797 2797 2798 2798 log.p = p; 2799 2799 log.size = size; 2800 2800 log.line = GC.line; 2801 2801 log.file = GC.file; 2802 2802 log.parent = null; 2803 2803 2804 2804 GC.line = 0; 2805 2805 GC.file = null; 2806 2806 2807 2807 current.push(log); 2808 2808 //debug(PRINTF) printf("-log_malloc()\n"); 2809 2809 } 2810 2810 2811 2811 2812 2812 void log_free(void *p) 2813 2813 { 2814 //debug(PRINTF) printf("+log_free(% x)\n", p);2814 //debug(PRINTF) printf("+log_free(%p)\n", p); 2815 2815 size_t i; 2816 2816 2817 2817 i = current.find(p); 2818 2818 if (i == OPFAIL) 2819 2819 { 2820 debug(PRINTF) printf("free'ing unallocated memory % x\n", p);2820 debug(PRINTF) printf("free'ing unallocated memory %p\n", p); 2821 2821 } 2822 2822 else 2823 2823 current.remove(i); 2824 2824 //debug(PRINTF) printf("-log_free()\n"); 2825 2825 } 2826 2826 2827 2827 2828 2828 void log_collect() 2829 2829 { 2830 2830 //debug(PRINTF) printf("+log_collect()\n"); … … 2869 2869 2870 2870 2871 2871 void log_parent(void *p, void *parent) 2872 2872 { 2873 2873 //debug(PRINTF) printf("+log_parent()\n"); 2874 2874 size_t i; 2875 2875 2876 2876 i = current.find(p); 2877 2877 if (i == OPFAIL) 2878 2878 { 2879 debug(PRINTF) printf("parent'ing unallocated memory % x, parent = %x\n", p, parent);2879 debug(PRINTF) printf("parent'ing unallocated memory %p, parent = %p\n", p, parent); 2880 2880 Pool *pool; 2881 2881 pool = findPool(p); 2882 2882 assert(pool); 2883 2883 size_t offset = cast(size_t)(p - pool.baseAddr); 2884 2884 size_t biti; 2885 2885 size_t pn = offset / PAGESIZE; 2886 2886 Bins bin = cast(Bins)pool.pagetable[pn]; 2887 2887 biti = (offset & notbinsize[bin]); 2888 2888 debug(PRINTF) printf("\tbin = %d, offset = x%x, biti = x%x\n", bin, offset, biti); 2889 2889 } … … 2932 2932 //debug(PRINTF) printf("Pool::Pool(%u)\n", npages); 2933 2933 poolsize = npages * PAGESIZE; 2934 2934 assert(poolsize >= POOLSIZE); 2935 2935 baseAddr = cast(byte *)os_mem_map(poolsize); 2936 2936 2937 2937 // Some of the code depends on page alignment of memory pools 2938 2938 assert((cast(size_t)baseAddr & (PAGESIZE - 1)) == 0); 2939 2939 2940 2940 if (!baseAddr) 2941 2941 { 2942 //debug(PRINTF) printf("GC fail: poolsize = x% x, errno = %d\n", poolsize, errno);2942 //debug(PRINTF) printf("GC fail: poolsize = x%zx, errno = %d\n", poolsize, errno); 2943 2943 //debug(PRINTF) printf("message = '%s'\n", sys_errlist[errno]); 2944 2944 2945 2945 npages = 0; 2946 2946 poolsize = 0; 2947 2947 } 2948 2948 //assert(baseAddr); 2949 2949 topAddr = baseAddr + poolsize; 2950 2950 2951 2951 mark.alloc(cast(size_t)poolsize / 16); 2952 2952 scan.alloc(cast(size_t)poolsize / 16);
