Mercurial > projects > ddmd
comparison dbg/CallStackInfo.d @ 73:ef02e2e203c2
Updating to dmd2.033
author | korDen |
---|---|
date | Sat, 28 Aug 2010 19:42:41 +0400 |
parents | 6bdecc3f4569 |
children | 7e0d548de9e6 |
comparison
equal
deleted
inserted
replaced
72:2e2a5c3f943a | 73:ef02e2e203c2 |
---|---|
191 | 191 |
192 extern (Windows) extern UINT SetErrorMode(UINT); | 192 extern (Windows) extern UINT SetErrorMode(UINT); |
193 alias LONG function(EXCEPTION_POINTERS*) PTOP_LEVEL_EXCEPTION_FILTER; | 193 alias LONG function(EXCEPTION_POINTERS*) PTOP_LEVEL_EXCEPTION_FILTER; |
194 extern (Windows) PTOP_LEVEL_EXCEPTION_FILTER SetUnhandledExceptionFilter(PTOP_LEVEL_EXCEPTION_FILTER); | 194 extern (Windows) PTOP_LEVEL_EXCEPTION_FILTER SetUnhandledExceptionFilter(PTOP_LEVEL_EXCEPTION_FILTER); |
195 | 195 |
196 void append(T)(T[] array, ref size_t index, T value) | 196 void append(T)(ref T[] array, ref size_t index, T value) |
197 { | 197 { |
198 size_t capacity = array.length; | 198 size_t capacity = array.length; |
199 assert(capacity >= index); | 199 assert(capacity >= index); |
200 if (capacity == index) { | 200 if (capacity == index) { |
201 if (capacity < 8) { | 201 if (capacity < 8) { |
202 capacity = 8; | 202 capacity = 8; |
203 } else { | 203 } else { |
204 array.length = capacity * 2; | 204 capacity *= 2; |
205 } | 205 } |
206 | |
207 array.length = capacity; | |
206 } | 208 } |
207 | 209 |
208 array[index++] = value; | 210 array[index++] = value; |
209 } | 211 } |
210 | 212 |