Change _d_newclass into _d_allocclass. Add initialization to ClassInfo.create.

This commit is contained in:
Christian Kamm
2008-10-26 14:12:03 +01:00
parent b8bd953dcf
commit cfcda83291
5 changed files with 12 additions and 8 deletions

View File

@@ -48,7 +48,7 @@ private
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 @@ class ClassInfo : Object
{
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);

View File

@@ -88,11 +88,11 @@ private
/**
*
*/
extern (C) Object _d_newclass(ClassInfo ci)
extern (C) Object _d_allocclass(ClassInfo ci)
{
void* p;
debug(PRINTF2) printf("_d_newclass(ci = %p, %s)\n", ci, cast(char *)ci.name.ptr);
debug(PRINTF2) printf("_d_allocclass(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

View File

@@ -94,7 +94,7 @@ void _d_monitorexit(Object *h);
int _d_isbaseof(ClassInfo *b, ClassInfo *c);
Object *_d_dynamic_cast(Object *o, ClassInfo *ci);
Object * _d_newclass(ClassInfo *ci);
Object * _d_allocclass(ClassInfo *ci);
void _d_delclass(Object **p);
void _d_OutOfMemory();