 |
Changeset 3725
- Timestamp:
- 07/08/08 13:40:55
(5 months ago)
- Author:
- keinfarbton
- Message:
Merged DMD 2.015
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3724 |
r3725 |
|
| 116 | 116 | * Thrown on call to hidden func |
|---|
| 117 | 117 | */ |
|---|
| 118 | | class HiddenFuncException : TracedException |
|---|
| | 118 | class HiddenFuncException : Exception |
|---|
| 119 | 119 | { |
|---|
| 120 | 120 | this( ClassInfo ci ) |
|---|
| r3724 |
r3725 |
|
| 544 | 544 | // a race condition with isRunning. The operation is labeled |
|---|
| 545 | 545 | // volatile to prevent compiler reordering. |
|---|
| 546 | | volatile m_addr = m_addr.init; |
|---|
| | 546 | /+volatile+/ m_addr = m_addr.init; |
|---|
| 547 | 547 | CloseHandle( m_hndl ); |
|---|
| 548 | 548 | m_hndl = m_hndl.init; |
|---|
| … | … | |
| 556 | 556 | // to zero ensures that pthread_detach will not be called |
|---|
| 557 | 557 | // on object destruction. |
|---|
| 558 | | volatile m_addr = m_addr.init; |
|---|
| | 558 | /+volatile+/ m_addr = m_addr.init; |
|---|
| 559 | 559 | } |
|---|
| 560 | 560 | if( rethrow && m_unhandled ) |
|---|
| … | … | |
| 670 | 670 | * the process. |
|---|
| 671 | 671 | */ |
|---|
| 672 | | static final int PRIORITY_MIN; |
|---|
| | 672 | static const int PRIORITY_MIN; |
|---|
| 673 | 673 | |
|---|
| 674 | 674 | |
|---|
| … | … | |
| 679 | 679 | * the process. |
|---|
| 680 | 680 | */ |
|---|
| 681 | | static final int PRIORITY_MAX; |
|---|
| | 681 | static const int PRIORITY_MAX; |
|---|
| 682 | 682 | |
|---|
| 683 | 683 | |
|---|
| … | … | |
| 2291 | 2291 | } |
|---|
| 2292 | 2292 | |
|---|
| 2293 | | final size_t PAGESIZE; |
|---|
| | 2293 | const size_t PAGESIZE; |
|---|
| 2294 | 2294 | } |
|---|
| 2295 | 2295 | |
|---|
| … | … | |
| 2334 | 2334 | |
|---|
| 2335 | 2335 | assert( Thread.getThis().m_curr is obj.m_ctxt ); |
|---|
| 2336 | | volatile Thread.getThis().m_lock = false; |
|---|
| | 2336 | /+volatile+/ Thread.getThis().m_lock = false; |
|---|
| 2337 | 2337 | obj.m_ctxt.tstack = obj.m_ctxt.bstack; |
|---|
| 2338 | 2338 | obj.m_state = Fiber.State.EXEC; |
|---|
| … | … | |
| 3201 | 3201 | // successive pop operations will succeed. |
|---|
| 3202 | 3202 | *oldp = getStackTop(); |
|---|
| 3203 | | volatile tobj.m_lock = true; |
|---|
| | 3203 | /+volatile+/ tobj.m_lock = true; |
|---|
| 3204 | 3204 | tobj.pushContext( m_ctxt ); |
|---|
| 3205 | 3205 | |
|---|
| … | … | |
| 3209 | 3209 | // to prevent Bad Things from happening. |
|---|
| 3210 | 3210 | tobj.popContext(); |
|---|
| 3211 | | volatile tobj.m_lock = false; |
|---|
| | 3211 | /+volatile+/ tobj.m_lock = false; |
|---|
| 3212 | 3212 | tobj.m_curr.tstack = tobj.m_curr.bstack; |
|---|
| 3213 | 3213 | } |
|---|
| … | … | |
| 3235 | 3235 | // successive pop operations will succeed. |
|---|
| 3236 | 3236 | *oldp = getStackTop(); |
|---|
| 3237 | | volatile tobj.m_lock = true; |
|---|
| | 3237 | /+volatile+/ tobj.m_lock = true; |
|---|
| 3238 | 3238 | |
|---|
| 3239 | 3239 | fiber_switchContext( oldp, newp ); |
|---|
| … | … | |
| 3241 | 3241 | // NOTE: As above, these operations must be performed in a strict order |
|---|
| 3242 | 3242 | // to prevent Bad Things from happening. |
|---|
| 3243 | | volatile tobj.m_lock = false; |
|---|
| | 3243 | /+volatile+/ tobj.m_lock = false; |
|---|
| 3244 | 3244 | tobj.m_curr.tstack = tobj.m_curr.bstack; |
|---|
| 3245 | 3245 | } |
|---|
| r3724 |
r3725 |
|
| 250 | 250 | body |
|---|
| 251 | 251 | { |
|---|
| | 252 | //printf("aaGet()\n"); |
|---|
| 252 | 253 | auto pkey = cast(void *)(&valuesize + 1); |
|---|
| 253 | 254 | size_t i; |
|---|
| 254 | 255 | aaA *e; |
|---|
| 255 | 256 | auto keysize = aligntsize(keyti.tsize()); |
|---|
| | 257 | //printf("keysize = %d\n", keysize); |
|---|
| 256 | 258 | |
|---|
| 257 | 259 | if (!aa.a) |
|---|
| … | … | |
| 577 | 579 | break; |
|---|
| 578 | 580 | } |
|---|
| | 581 | //printf("rehash %d x%x\n", len, len); |
|---|
| 579 | 582 | len = prime_list[i]; |
|---|
| 580 | 583 | newb.b = new aaA*[len]; |
|---|
| r3724 |
r3725 |
|
| 73 | 73 | } |
|---|
| 74 | 74 | |
|---|
| | 75 | unittest |
|---|
| | 76 | { |
|---|
| | 77 | int[][] a = [[5,3,8,7], [2,5,3,8,7]]; |
|---|
| | 78 | a.sort; |
|---|
| | 79 | assert(a == [[2,5,3,8,7], [5,3,8,7]]); |
|---|
| | 80 | |
|---|
| | 81 | a = [[5,3,8,7], [5,3,8]]; |
|---|
| | 82 | a.sort; |
|---|
| | 83 | assert(a == [[5,3,8], [5,3,8,7]]); |
|---|
| | 84 | } |
|---|
| | 85 | |
|---|
| 75 | 86 | // uint[] |
|---|
| 76 | 87 | |
|---|
| r3724 |
r3725 |
|
| 1 | 1 | /* |
|---|
| 2 | | * Copyright (C) 2004-2005 by Digital Mars, www.digitalmars.com |
|---|
| | 2 | * Copyright (C) 2004-2008 by Digital Mars, www.digitalmars.com |
|---|
| 3 | 3 | * Written by Walter Bright |
|---|
| 4 | 4 | * |
|---|
| r3724 |
r3725 |
|
| 81 | 81 | // 1: // has possible pointers into GC memory |
|---|
| 82 | 82 | OffsetTypeInfo[] offTi(); |
|---|
| | 83 | void destroy(void *p); |
|---|
| | 84 | void postblit(void *p); |
|---|
| 83 | 85 | } |
|---|
| 84 | 86 | |
|---|
| … | … | |
| 149 | 151 | |
|---|
| 150 | 152 | const(MemberInfo[]) function(Cutf8) xgetMembers; |
|---|
| | 153 | void function(void*) xdtor; |
|---|
| | 154 | void function(void*) xpostblit; |
|---|
| 151 | 155 | } |
|---|
| 152 | 156 | |
|---|
| … | … | |
| 177 | 181 | |
|---|
| 178 | 182 | static int opApply( int delegate( inout ModuleInfo ) ); |
|---|
| | 183 | } |
|---|
| | 184 | |
|---|
| | 185 | abstract class MemberInfo |
|---|
| | 186 | { |
|---|
| | 187 | Cutf8 name(); |
|---|
| | 188 | } |
|---|
| | 189 | |
|---|
| | 190 | class MemberInfo_field : MemberInfo |
|---|
| | 191 | { |
|---|
| | 192 | this(Cutf8 name, TypeInfo ti, size_t offset) |
|---|
| | 193 | { |
|---|
| | 194 | m_name = name; |
|---|
| | 195 | m_typeinfo = ti; |
|---|
| | 196 | m_offset = offset; |
|---|
| | 197 | } |
|---|
| | 198 | |
|---|
| | 199 | override Cutf8 name() { return m_name; } |
|---|
| | 200 | TypeInfo typeInfo() { return m_typeinfo; } |
|---|
| | 201 | size_t offset() { return m_offset; } |
|---|
| | 202 | |
|---|
| | 203 | Cutf8 m_name; |
|---|
| | 204 | TypeInfo m_typeinfo; |
|---|
| | 205 | size_t m_offset; |
|---|
| | 206 | } |
|---|
| | 207 | |
|---|
| | 208 | class MemberInfo_function : MemberInfo |
|---|
| | 209 | { |
|---|
| | 210 | this(Cutf8 name, TypeInfo ti, void* fp, uint flags) |
|---|
| | 211 | { |
|---|
| | 212 | m_name = name; |
|---|
| | 213 | m_typeinfo = ti; |
|---|
| | 214 | m_fp = fp; |
|---|
| | 215 | m_flags = flags; |
|---|
| | 216 | } |
|---|
| | 217 | |
|---|
| | 218 | override Cutf8 name() { return m_name; } |
|---|
| | 219 | TypeInfo typeInfo() { return m_typeinfo; } |
|---|
| | 220 | void* fp() { return m_fp; } |
|---|
| | 221 | uint flags() { return m_flags; } |
|---|
| | 222 | |
|---|
| | 223 | |
|---|
| | 224 | Cutf8 m_name; |
|---|
| | 225 | TypeInfo m_typeinfo; |
|---|
| | 226 | void* m_fp; |
|---|
| | 227 | uint m_flags; |
|---|
| 179 | 228 | } |
|---|
| 180 | 229 | |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2008 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic