Mercurial > projects > ldc
diff tango/lib/compiler/llvmdc/lifetime.d @ 133:44a95ac7368a trunk
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
In particular, assertions has been fixed to include file/line info, and much more!
author | lindquist |
---|---|
date | Mon, 14 Jan 2008 05:11:54 +0100 |
parents | 1700239cab2e |
children | ce7b81fb957f |
line wrap: on
line diff
--- a/tango/lib/compiler/llvmdc/lifetime.d Fri Jan 11 17:57:40 2008 +0100 +++ b/tango/lib/compiler/llvmdc/lifetime.d Mon Jan 14 05:11:54 2008 +0100 @@ -26,6 +26,8 @@ */ module lifetime; +//debug=PRINTF; +debug=PRINTF2; private { @@ -33,6 +35,7 @@ import tango.stdc.string; import tango.stdc.stdarg; debug(PRINTF) import tango.stdc.stdio; + else debug(PRINTF2) import tango.stdc.stdio; } @@ -86,7 +89,8 @@ { void* p; - debug(PRINTF) printf("_d_newclass(ci = %p, %s)\n", ci, cast(char *)ci.name); + debug(PRINTF) printf("_d_newclass(ci = %p, %s)\n", ci, cast(char *)ci.name.ptr); + /+ if (ci.flags & 1) // if COM object { /* COM objects are not garbage collected, they are reference counted * using AddRef() and Release(). They get free'd by C's free() @@ -98,10 +102,11 @@ onOutOfMemoryError(); } else + +/ { p = gc_malloc(ci.init.length, BlkAttr.FINALIZE | (ci.flags & 2 ? BlkAttr.NO_SCAN : 0)); - debug(PRINTF) printf(" p = %p\n", p); + debug(PRINTF2) printf(" p = %p\n", p); } debug(PRINTF) @@ -119,7 +124,8 @@ } // initialize it - (cast(byte*) p)[0 .. ci.init.length] = ci.init[]; + // llvmdc does this inline + //(cast(byte*) p)[0 .. ci.init.length] = ci.init[]; debug(PRINTF) printf("initialization done\n"); return cast(Object) p;