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

Commit

Permalink
Merge pull request #1113 from rainers/sdtor_fix
Browse files Browse the repository at this point in the history
fixup merge error with array reallocation for struct destructors
  • Loading branch information
MartinNowak committed Jan 22, 2015
2 parents c4e934b + d7ed15a commit 083fc12
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/rt/lifetime.d
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ void[] _d_newarrayOpT(alias op)(const TypeInfo ti, size_t[] dims)
}

auto allocsize = (void[]).sizeof * dim;
auto info = GC.qalloc(allocsize + __arrayPad(allocsize, tinext), 0, ti);
auto info = __arrayAlloc(allocsize, ti, tinext);
auto isshared = typeid(ti) is typeid(TypeInfo_Shared);
__setArrayAllocLength(info, allocsize, isshared, tinext);
auto p = __arrayStart(info)[0 .. dim];
Expand Down Expand Up @@ -1632,11 +1632,11 @@ body
// a chance that flags have changed since this was cached, we should fetch the most recent flags
info.attr = GC.getAttr(info.base) | BlkAttr.APPENDABLE;
}
info = GC.qalloc(newsize + __arrayPad(newsize, tinext), info.attr, ti);
info = __arrayAlloc(newsize, info, ti, tinext);
}
else
{
info = GC.qalloc(newsize + __arrayPad(newsize, tinext), !(ti.next.flags & 1) ? (BlkAttr.NO_SCAN | BlkAttr.APPENDABLE) : BlkAttr.APPENDABLE, ti);
info = __arrayAlloc(newsize, ti, tinext);
}
__setArrayAllocLength(info, newsize, isshared, tinext);
if(!isshared)
Expand Down Expand Up @@ -1816,11 +1816,11 @@ body
// a chance that flags have changed since this was cached, we should fetch the most recent flags
info.attr = GC.getAttr(info.base) | BlkAttr.APPENDABLE;
}
info = GC.qalloc(newsize + __arrayPad(newsize, tinext), info.attr, ti);
info = __arrayAlloc(newsize, info, ti, tinext);
}
else
{
info = GC.qalloc(newsize + __arrayPad(newsize, tinext), !(ti.next.flags & 1) ? (BlkAttr.NO_SCAN | BlkAttr.APPENDABLE) : BlkAttr.APPENDABLE, ti);
info = __arrayAlloc(newsize, ti, tinext);
}
__setArrayAllocLength(info, newsize, isshared, tinext);
if(!isshared)
Expand Down Expand Up @@ -2057,11 +2057,11 @@ byte[] _d_arrayappendcTX(const TypeInfo ti, ref byte[] px, size_t n)
// a chance that flags have changed since this was cached, we should fetch the most recent flags
info.attr = GC.getAttr(info.base) | BlkAttr.APPENDABLE;
}
info = GC.qalloc(newcap + __arrayPad(newcap, tinext), info.attr, ti);
info = __arrayAlloc(newcap, info, ti, tinext);
}
else
{
info = GC.qalloc(newcap + __arrayPad(newcap, tinext), !(ti.next.flags & 1) ? (BlkAttr.NO_SCAN | BlkAttr.APPENDABLE) : BlkAttr.APPENDABLE, ti);
info = __arrayAlloc(newcap, ti, tinext);
}
__setArrayAllocLength(info, newsize, isshared, tinext);
if(!isshared)
Expand Down

0 comments on commit 083fc12

Please sign in to comment.