Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions runtime/druntime/src/core/internal/array/capacity.d
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,10 @@ private size_t _d_arraysetlengthT_(Tarr : T[], T)(return ref scope Tarr arr, siz
if (!arr.ptr)
{
assert(arr.length == 0);
void* ptr = GC.malloc(newsize, gcAttrs);
version (D_TypeInfo)
void* ptr = GC.malloc(newsize, gcAttrs, typeid(T));
else
void* ptr = GC.malloc(newsize, gcAttrs, null);
if (!ptr)
{
onOutOfMemoryError();
Expand Down Expand Up @@ -315,7 +318,10 @@ private size_t _d_arraysetlengthT_(Tarr : T[], T)(return ref scope Tarr arr, siz

if (!gc_expandArrayUsed(newdata[0 .. oldsize], newsize, isShared))
{
newdata = GC.malloc(newsize, gcAttrs);
version (D_TypeInfo)
newdata = GC.malloc(newsize, gcAttrs, typeid(T));
else
newdata = GC.malloc(newsize, gcAttrs, null);
if (!newdata)
{
onOutOfMemoryError();
Expand Down
Loading