diff --git a/runtime/druntime/src/core/internal/array/capacity.d b/runtime/druntime/src/core/internal/array/capacity.d index 8ab8958e777..2a76826dfbe 100644 --- a/runtime/druntime/src/core/internal/array/capacity.d +++ b/runtime/druntime/src/core/internal/array/capacity.d @@ -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(); @@ -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();