mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-03 11:03:14 +01:00
Change _d_newclass into _d_allocclass. Add initialization to ClassInfo.create.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user