Mercurial > projects > ddmd
comparison dmd/TypeDArray.d @ 23:460959608115
Branch merge.
author | Robert Clipsham <robert@octarineparrot.com> |
---|---|
date | Mon, 12 Apr 2010 17:00:08 +0100 |
parents | 832f71e6f96c 01cadcfa4842 |
children | 2e2a5c3f943a |
comparison
equal
deleted
inserted
replaced
13:427f8aa74d28 | 23:460959608115 |
---|---|
33 import dmd.backend.TYM; | 33 import dmd.backend.TYM; |
34 import dmd.backend.LIST; | 34 import dmd.backend.LIST; |
35 | 35 |
36 import core.stdc.stdlib; | 36 import core.stdc.stdlib; |
37 import core.stdc.stdio; | 37 import core.stdc.stdio; |
38 version (Bug4054) import core.memory; | |
38 | 39 |
39 // Dynamic array, no dimension | 40 // Dynamic array, no dimension |
40 class TypeDArray : TypeArray | 41 class TypeDArray : TypeArray |
41 { | 42 { |
42 this(Type t) | 43 this(Type t) |
298 */ | 299 */ |
299 Symbol* s; | 300 Symbol* s; |
300 char *id; | 301 char *id; |
301 | 302 |
302 assert(next.deco); | 303 assert(next.deco); |
304 version (Bug4054) | |
305 id = cast(char*) GC.malloc(7 + next.deco.length + 1); | |
306 else | |
303 id = cast(char*) alloca(7 + next.deco.length + 1); | 307 id = cast(char*) alloca(7 + next.deco.length + 1); |
304 sprintf(id, "_Array_%.*s", next.deco); | 308 sprintf(id, "_Array_%.*s", next.deco); |
305 s = symbol_calloc(id); | 309 s = symbol_calloc(id); |
306 s.Sclass = SC.SCstruct; | 310 s.Sclass = SC.SCstruct; |
307 s.Sstruct = struct_calloc(); | 311 s.Sstruct = struct_calloc(); |