 |
Changeset 2020
- Timestamp:
- 04/11/07 14:41:13
(2 years ago)
- Author:
- sean
- Message:
Merged in DMD 1.011 changes. These are just some minor bugfixes for existing functionality, so these libraries are compatible with DMD 1.010 as well.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1971 |
r2020 |
|
| 785 | 785 | |
|---|
| 786 | 786 | *cast(size_t *)&x = newlength; |
|---|
| 787 | | (cast(byte *)x)[length * sizeelem .. newsize] = argp[0 .. sizeelem]; |
|---|
| | 787 | x.ptr[length * sizeelem .. newsize] = argp[0 .. sizeelem]; |
|---|
| 788 | 788 | assert((cast(size_t)x.ptr & 15) == 0); |
|---|
| 789 | 789 | assert(gc_sizeOf(x.ptr) > x.length * sizeelem); |
|---|
| r1971 |
r2020 |
|
| 786 | 786 | L1: |
|---|
| 787 | 787 | *cast(size_t *)&x = newlength; |
|---|
| 788 | | (cast(byte *)x)[length * sizeelem .. newsize] = (cast(byte*)argp)[0 .. sizeelem]; |
|---|
| | 788 | x.ptr[length * sizeelem .. newsize] = argp[0 .. sizeelem]; |
|---|
| 789 | 789 | assert((cast(size_t)x.ptr & 15) == 0); |
|---|
| 790 | 790 | assert(gc_sizeOf(x.ptr) > x.length * sizeelem); |
|---|
| r1971 |
r2020 |
|
| 94 | 94 | extern (C) void thread_scanAll( scanFn fn, void* curStackTop = null ); |
|---|
| 95 | 95 | } |
|---|
| | 96 | |
|---|
| | 97 | extern (C) void onOutOfMemoryError(); |
|---|
| 96 | 98 | } |
|---|
| 97 | 99 | |
|---|
| … | … | |
| 148 | 150 | { |
|---|
| 149 | 151 | data = cast(Log *)tango.stdc.stdlib.malloc(allocdim * Log.sizeof); |
|---|
| | 152 | if (!data && allocdim) |
|---|
| | 153 | onOutOfMemoryError(); |
|---|
| 150 | 154 | } |
|---|
| 151 | 155 | else |
|---|
| … | … | |
| 153 | 157 | |
|---|
| 154 | 158 | newdata = cast(Log *)tango.stdc.stdlib.malloc(allocdim * Log.sizeof); |
|---|
| 155 | | assert(newdata); |
|---|
| | 159 | if (!newdata && allocdim) |
|---|
| | 160 | onOutOfMemoryError(); |
|---|
| 156 | 161 | memcpy(newdata, data, dim * Log.sizeof); |
|---|
| 157 | 162 | tango.stdc.stdlib.free(data); |
|---|
| 158 | 163 | data = newdata; |
|---|
| 159 | 164 | } |
|---|
| 160 | | assert(!allocdim || data); |
|---|
| 161 | 165 | } |
|---|
| 162 | 166 | } |
|---|
| … | … | |
| 223 | 227 | gcLock = GCLock.classinfo; |
|---|
| 224 | 228 | gcx = cast(Gcx *)tango.stdc.stdlib.calloc(1, Gcx.sizeof); |
|---|
| | 229 | if (!gcx) |
|---|
| | 230 | onOutOfMemoryError(); |
|---|
| 225 | 231 | gcx.initialize(); |
|---|
| 226 | 232 | setStackBottom(cr_stackBottom()); |
|---|
| … | … | |
| 1410 | 1416 | |
|---|
| 1411 | 1417 | newroots = cast(void **)tango.stdc.stdlib.malloc(newdim * newroots[0].sizeof); |
|---|
| 1412 | | assert(newroots); |
|---|
| | 1418 | if (!newroots) |
|---|
| | 1419 | onOutOfMemoryError(); |
|---|
| 1413 | 1420 | if (roots) |
|---|
| 1414 | 1421 | { memcpy(newroots, roots, nroots * newroots[0].sizeof); |
|---|
| … | … | |
| 1454 | 1461 | |
|---|
| 1455 | 1462 | newranges = cast(Range *)tango.stdc.stdlib.malloc(newdim * newranges[0].sizeof); |
|---|
| 1456 | | assert(newranges); |
|---|
| | 1463 | if (!newranges) |
|---|
| | 1464 | onOutOfMemoryError(); |
|---|
| 1457 | 1465 | if (ranges) |
|---|
| 1458 | 1466 | { memcpy(newranges, ranges, nranges * newranges[0].sizeof); |
|---|
| … | … | |
| 1707 | 1715 | if (npages < POOLSIZE/PAGESIZE) |
|---|
| 1708 | 1716 | npages = POOLSIZE/PAGESIZE; |
|---|
| | 1717 | else if (npages > POOLSIZE/PAGESIZE) |
|---|
| | 1718 | { // Give us 150% of requested size, so there's room to extend |
|---|
| | 1719 | auto n = npages + (npages >> 1); |
|---|
| | 1720 | if (n < size_t.max/PAGESIZE) |
|---|
| | 1721 | npages = n; |
|---|
| | 1722 | } |
|---|
| 1709 | 1723 | |
|---|
| 1710 | 1724 | // Allocate successively larger pools up to 8 megs |
|---|
| … | … | |
| 2458 | 2472 | |
|---|
| 2459 | 2473 | pagetable = cast(ubyte*)tango.stdc.stdlib.malloc(npages); |
|---|
| | 2474 | if (!pagetable) |
|---|
| | 2475 | onOutOfMemoryError(); |
|---|
| 2460 | 2476 | memset(pagetable, B_UNCOMMITTED, npages); |
|---|
| 2461 | 2477 | |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2008 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic