comparison dmd/Scope.d @ 83:ee670dd808a8

malloc -> GC.malloc change, plus compilation issues fixed (always check before commiting stuff!!!)
author korDen
date Mon, 30 Aug 2010 18:42:04 +0400
parents e95073e26356
children 786ea1839396 e28b18c23469
comparison
equal deleted inserted replaced
82:e95073e26356 83:ee670dd808a8
24 import dmd.DsymbolTable; 24 import dmd.DsymbolTable;
25 import dmd.Global; 25 import dmd.Global;
26 import dmd.CSX; 26 import dmd.CSX;
27 import dmd.Util; 27 import dmd.Util;
28 28
29 import core.memory;
30
29 enum SCOPE 31 enum SCOPE
30 { 32 {
31 SCOPEctor = 1, // constructor type 33 SCOPEctor = 1, // constructor type
32 SCOPEstaticif = 2, // inside static if 34 SCOPEstaticif = 2, // inside static if
33 SCOPEfree = 4, // is on free list 35 SCOPEfree = 4, // is on free list
169 Scope clone() 171 Scope clone()
170 { 172 {
171 // similar code is used in Type.clone() 173 // similar code is used in Type.clone()
172 // TODO: move to Util or something... 174 // TODO: move to Util or something...
173 size_t size = __traits(classInstanceSize, typeof(this)); 175 size_t size = __traits(classInstanceSize, typeof(this));
174 void* mem = malloc(size); 176 void* mem = GC.malloc(size);
175 memcpy(mem, this, size); 177 memcpy(mem, cast(void*)this, size);
176 178
177 return cast(typeof(this))mem; 179 return cast(typeof(this))mem;
178 } 180 }
179 181
180 Scope push() 182 Scope push()