diff --git a/src/rt/lifetime.d b/src/rt/lifetime.d index b82dc55e04..390147210a 100644 --- a/src/rt/lifetime.d +++ b/src/rt/lifetime.d @@ -39,17 +39,8 @@ private } } -private immutable bool callStructDtorsDuringGC; - extern (C) void lifetime_init() { - // this is run before static ctors, so it is safe to modify immutables - import rt.config; - string s = rt_configOption("callStructDtorsDuringGC"); - if (s != null) - cast() callStructDtorsDuringGC = s[0] == '1' || s[0] == 'y' || s[0] == 'Y'; - else - cast() callStructDtorsDuringGC = true; } /** @@ -212,9 +203,6 @@ inout(TypeInfo) unqualify(inout(TypeInfo) cti) pure nothrow @nogc // size used to store the TypeInfo at the end of an allocation for structs that have a destructor 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; @@ -2590,7 +2578,6 @@ unittest delete arr1; assert(dtorCount == 7); - if (callStructDtorsDuringGC) { dtorCount = 0; S1* s2 = new S1; @@ -2624,7 +2611,6 @@ unittest arr2.assumeSafeAppend; assert(dtorCount == 4); // destructors run explicitely? - if (callStructDtorsDuringGC) { dtorCount = 0; BlkInfo blkinf = GC.query(arr2.ptr); @@ -2641,7 +2627,6 @@ unittest S1[int] aa1; aa1[0] = S1(0); aa1[1] = S1(1); - if (callStructDtorsDuringGC) { dtorCount = 0; aa1 = null; @@ -2653,7 +2638,6 @@ unittest aa2[S1(0)] = 0; aa2[S1(1)] = 1; aa2[S1(2)] = 2; - if (callStructDtorsDuringGC) { dtorCount = 0; aa2 = null; @@ -2664,7 +2648,6 @@ unittest S1[2][int] aa3; aa3[0] = [S1(0),S1(2)]; aa3[1] = [S1(1),S1(3)]; - if (callStructDtorsDuringGC) { dtorCount = 0; aa3 = null; @@ -2712,9 +2695,6 @@ unittest debug(SENTINEL) {} else unittest { - if (!callStructDtorsDuringGC) - return; - bool test(E)() { import core.exception;