Changeset 3078
- Timestamp:
- 01/08/08 21:04:34 (1 year ago)
- Files:
-
- trunk/lib/common/tango/posix.mak (modified) (1 diff)
- trunk/lib/compiler/dmd/posix.mak (modified) (1 diff)
- trunk/lib/gc/basic/gc.d (modified) (1 diff)
- trunk/lib/gc/basic/gcx.d (modified) (18 diffs)
- trunk/lib/gc/basic/posix.mak (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/common/tango/posix.mak
r3031 r3078 21 21 ADD_DFLAGS= 22 22 23 CFLAGS=-O -m32$(ADD_CFLAGS)24 #CFLAGS=-g -m32$(ADD_CFLAGS)23 CFLAGS=-O $(ADD_CFLAGS) 24 #CFLAGS=-g $(ADD_CFLAGS) 25 25 26 26 DFLAGS=-release -O -inline -w -nofloat -version=Posix $(ADD_DFLAGS) trunk/lib/compiler/dmd/posix.mak
r3031 r3078 18 18 MD=mkdir -p 19 19 20 CFLAGS=-O -m32$(ADD_CFLAGS)21 #CFLAGS=-g -m32$(ADD_CFLAGS)20 CFLAGS=-O $(ADD_CFLAGS) 21 #CFLAGS=-g $(ADD_CFLAGS) 22 22 23 23 DFLAGS=-release -O -inline -w -nofloat -version=Posix $(ADD_DFLAGS) trunk/lib/gc/basic/gc.d
r3073 r3078 155 155 extern (C) GCStats gc_stats() 156 156 { 157 GCStats stats ;158 _gc.getStats( stats);157 GCStats stats = void; 158 _gc.getStats( stats ); 159 159 return stats; 160 160 } trunk/lib/gc/basic/gcx.d
r3076 r3078 102 102 103 103 extern (C) void onOutOfMemoryError(); 104 105 enum 106 { 107 OPFAIL = ~cast(size_t)0 108 } 104 109 } 105 110 … … 193 198 return i; 194 199 } 195 return ~0u;// not found200 return OPFAIL; // not found 196 201 } 197 202 … … 662 667 { 663 668 auto u = pool.extendPages(pagenum + newsz - pool.ncommitted); 664 if (u == ~0u)669 if (u == OPFAIL) 665 670 break; 666 671 i = pagenum + newsz; … … 775 780 { 776 781 auto u = pool.extendPages(minsz - sz); 777 if (u == ~0u)782 if (u == OPFAIL) 778 783 return 0; 779 784 sz = minsz; … … 1408 1413 byte *maxAddr; // max(topAddr) 1409 1414 1410 uint npools;1415 size_t npools; 1411 1416 Pool **pooltable; 1412 1417 … … 1828 1833 Pool* pool = newPool(npages); 1829 1834 1830 if (!pool || pool.extendPages(npages) == ~0u)1835 if (!pool || pool.extendPages(npages) == OPFAIL) 1831 1836 return 0; 1832 1837 return pool.ncommitted * PAGESIZE; … … 1859 1864 pool = pooltable[n]; 1860 1865 pn = pool.allocPages(npages); 1861 if (pn != ~0u)1866 if (pn != OPFAIL) 1862 1867 goto L1; 1863 1868 } … … 1884 1889 } 1885 1890 pn = pool.allocPages(npages); 1886 assert(pn != ~0u);1891 assert(pn != OPFAIL); 1887 1892 goto L1; 1888 1893 case 1: … … 1892 1897 goto Lnomemory; 1893 1898 pn = pool.allocPages(npages); 1894 assert(pn != ~0u);1899 assert(pn != OPFAIL); 1895 1900 goto L1; 1896 1901 case 2: … … 2009 2014 pool = pooltable[n]; 2010 2015 pn = pool.allocPages(1); 2011 if (pn != ~0u)2016 if (pn != OPFAIL) 2012 2017 goto L1; 2013 2018 } … … 2253 2258 continue; 2254 2259 2255 pn = (o - pool.baseAddr) / PAGESIZE;2260 pn = cast(size_t)(o - pool.baseAddr) / PAGESIZE; 2256 2261 bin = cast(Bins)pool.pagetable[pn]; 2257 2262 if (bin < B_PAGE) … … 2557 2562 2558 2563 i = current.find(p); 2559 if (i == ~0u)2564 if (i == OPFAIL) 2560 2565 { 2561 2566 debug(PRINTF) printf("free'ing unallocated memory %x\n", p); … … 2579 2584 2580 2585 j = prev.find(current.data[i].p); 2581 if (j == ~0u)2586 if (j == OPFAIL) 2582 2587 current.data[i].print(); 2583 2588 else … … 2595 2600 { 2596 2601 j = prev.find(current.data[i].p); 2597 if (j == ~0u)2602 if (j == OPFAIL) 2598 2603 debug(PRINTF) printf("N"); 2599 2604 else … … 2616 2621 2617 2622 i = current.find(p); 2618 if (i == ~0u)2623 if (i == OPFAIL) 2619 2624 { 2620 2625 debug(PRINTF) printf("parent'ing unallocated memory %x, parent = %x\n", p, parent); … … 2767 2772 /** 2768 2773 * Allocate n pages from Pool. 2769 * Returns ~0uon failure.2770 */ 2771 uint allocPages(size_t n)2774 * Returns OPFAIL on failure. 2775 */ 2776 size_t allocPages(size_t n) 2772 2777 { 2773 2778 size_t i; … … 2793 2798 /** 2794 2799 * Extend Pool by n pages. 2795 * Returns ~0uon failure.2796 */ 2797 uint extendPages(size_t n)2800 * Returns OPFAIL on failure. 2801 */ 2802 size_t extendPages(size_t n) 2798 2803 { 2799 2804 //debug(PRINTF) printf("Pool::extendPages(n = %d)\n", n); … … 2821 2826 } 2822 2827 2823 return ~0u;2828 return OPFAIL; 2824 2829 } 2825 2830 trunk/lib/gc/basic/posix.mak
r3031 r3078 21 21 ADD_DFLAGS= 22 22 23 CFLAGS=-O -m32$(ADD_CFLAGS)24 #CFLAGS=-g -m32$(ADD_CFLAGS)23 CFLAGS=-O $(ADD_CFLAGS) 24 #CFLAGS=-g $(ADD_CFLAGS) 25 25 26 26 DFLAGS=-release -O -inline -w -nofloat -version=Posix $(ADD_DFLAGS)












