Mercurial > projects > ldc
diff runtime/internal/genobj.d @ 728:635f91212b78
Change _d_newclass into _d_allocclass. Add initialization to ClassInfo.create.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 26 Oct 2008 14:12:03 +0100 |
parents | eef8ac26c66c |
children | 09b88beffd2d |
line wrap: on
line diff
--- a/runtime/internal/genobj.d Sun Oct 26 14:11:14 2008 +0100 +++ b/runtime/internal/genobj.d Sun Oct 26 14:12:03 2008 +0100 @@ -48,7 +48,7 @@ debug(PRINTF) import tango.stdc.stdio; // : printf; extern (C) void onOutOfMemoryError(); - extern (C) Object _d_newclass(ClassInfo ci); + extern (C) Object _d_allocclass(ClassInfo ci); } // NOTE: For some reason, this declaration method doesn't work @@ -188,7 +188,11 @@ { if (flags & 8 && !defaultConstructor) return null; - Object o = _d_newclass(this); + + Object o = _d_allocclass(this); + // initialize it + (cast(byte*) o)[0 .. init.length] = init[]; + if (flags & 8 && defaultConstructor) { defaultConstructor(o);