Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Removed the callStructDtorsDuringGC field in core/memory.d.
Browse files Browse the repository at this point in the history
Trimmed the trailing whitespace on a couple of lines in rt/lifetime.d.
  • Loading branch information
Orvid committed Jan 14, 2015
1 parent 17ef8cd commit bfaa918
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/core/memory.d
Original file line number Diff line number Diff line change
Expand Up @@ -763,5 +763,3 @@ struct GC
gc_runFinalizers( segment );
}
}

__gshared bool callStructDtorsDuringGC = true;
8 changes: 4 additions & 4 deletions src/rt/lifetime.d
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ extern (C) void _d_delstruct(void** p, TypeInfo_Struct inf)
if (*p)
{
debug(PRINTF) printf("_d_delstruct(%p, %p)\n", *p, cast(void*)inf);

inf.xdtor(*p);

GC.free(*p);
*p = null;
}
Expand Down Expand Up @@ -216,7 +216,7 @@ size_t structTypeInfoSize(const TypeInfo ti) pure nothrow @nogc
{
if (!callStructDtorsDuringGC)
return 0;

if (ti && typeid(ti) is typeid(TypeInfo_Struct)) // avoid a complete dynamic type cast
{
auto sti = cast(TypeInfo_Struct)cast(void*)ti;
Expand Down Expand Up @@ -400,7 +400,7 @@ size_t __arrayAllocLength(ref BlkInfo info, const TypeInfo tinext) pure nothrow

if(info.size < PAGESIZE)
return *cast(ushort *)(info.base + info.size - structTypeInfoSize(tinext) - MEDPAD);

return *cast(size_t *)(info.base);
}

Expand Down

0 comments on commit bfaa918

Please sign in to comment.