Mercurial > projects > ddmd
annotate dmd/TypeInfoArrayDeclaration.d @ 191:52188e7e3fb5
Fixed deprecated features, now compiles with DMD2.058
Also changed Array allocation policy:
Now doesn't reallocate but malloc's, followed by a memcpy (no free).
(this fixes a crash while compiling druntime. Same bug in dmd)
author | korDen@korDen-pc |
---|---|
date | Sun, 25 Mar 2012 03:11:12 +0400 |
parents | b0d41ff5e0df |
children |
rev | line source |
---|---|
72 | 1 module dmd.TypeInfoArrayDeclaration; |
2 | |
114 | 3 import dmd.common; |
72 | 4 import dmd.Type; |
0 | 5 import dmd.TypeInfoDeclaration; |
6 import dmd.Type; | |
7 import dmd.TY; | |
8 import dmd.TypeDArray; | |
174 | 9 import dmd.Global; |
72 | 10 |
0 | 11 import dmd.backend.dt_t; |
12 import dmd.backend.Util; | |
72 | 13 import dmd.backend.TYM; |
14 | |
187
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
15 import dmd.DDMDExtensions; |
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
16 |
0 | 17 class TypeInfoArrayDeclaration : TypeInfoDeclaration |
18 { | |
187
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
19 mixin insertMemberExtension!(typeof(this)); |
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
20 |
0 | 21 this(Type tinfo) |
22 { | |
178 | 23 register(); |
0 | 24 super(tinfo, 0); |
174 | 25 type = global.typeinfoarray.type; |
0 | 26 } |
27 | |
72 | 28 override void toDt(dt_t** pdt) |
0 | 29 { |
30 //printf("TypeInfoArrayDeclaration::toDt()\n"); | |
174 | 31 dtxoff(pdt, global.typeinfoarray.toVtblSymbol(), 0, TYnptr); // vtbl for TypeInfo_Array |
0 | 32 dtdword(pdt, 0); // monitor |
33 | |
34 assert(tinfo.ty == Tarray); | |
35 | |
36 TypeDArray tc = cast(TypeDArray)tinfo; | |
37 | |
38 tc.next.getTypeInfo(null); | |
39 dtxoff(pdt, tc.next.vtinfo.toSymbol(), 0, TYnptr); // TypeInfo for array of type | |
40 } | |
41 } | |
42 |