From 649223bff5e66842a174f8be07cbbd8d6a5ddc39 Mon Sep 17 00:00:00 2001 From: Dennis Date: Fri, 21 Mar 2025 23:36:00 +0100 Subject: [PATCH] Remove redundant GC allocation for _d_newarraymTX.dims (#21051) --- druntime/src/core/internal/array/construction.d | 4 ++-- druntime/test/profile/myprofilegc.log.freebsd.32.exp | 2 -- druntime/test/profile/myprofilegc.log.freebsd.64.exp | 2 -- druntime/test/profile/myprofilegc.log.linux.32.exp | 2 -- druntime/test/profile/myprofilegc.log.linux.64.exp | 2 -- druntime/test/profile/myprofilegc.log.osx.32.exp | 2 -- druntime/test/profile/myprofilegc.log.osx.64.exp | 2 -- druntime/test/profile/myprofilegc.log.windows.32.exp | 2 -- druntime/test/profile/myprofilegc.log.windows.64.exp | 2 -- 9 files changed, 2 insertions(+), 18 deletions(-) diff --git a/druntime/src/core/internal/array/construction.d b/druntime/src/core/internal/array/construction.d index 40e5a61bbd..722aed46d1 100644 --- a/druntime/src/core/internal/array/construction.d +++ b/druntime/src/core/internal/array/construction.d @@ -505,7 +505,7 @@ version (D_ProfileGC) * Returns: * newly allocated array */ -Tarr _d_newarraymTX(Tarr : U[], T, U)(size_t[] dims, bool isShared=false) @trusted +Tarr _d_newarraymTX(Tarr : U[], T, U)(scope size_t[] dims, bool isShared=false) @trusted { debug(PRINTF) printf("_d_newarraymTX(dims.length = %zd)\n", dims.length); @@ -602,7 +602,7 @@ version (D_ProfileGC) /** * TraceGC wrapper around $(REF _d_newarraymT, core,internal,array,construction). */ - Tarr _d_newarraymTXTrace(Tarr : U[], T, U)(size_t[] dims, bool isShared=false, string file = __FILE__, int line = __LINE__, string funcname = __FUNCTION__) @trusted + Tarr _d_newarraymTXTrace(Tarr : U[], T, U)(scope size_t[] dims, bool isShared=false, string file = __FILE__, int line = __LINE__, string funcname = __FUNCTION__) @trusted { version (D_TypeInfo) { diff --git a/druntime/test/profile/myprofilegc.log.freebsd.32.exp b/druntime/test/profile/myprofilegc.log.freebsd.32.exp index 0053d15aaa..c610fbdbd7 100644 --- a/druntime/test/profile/myprofilegc.log.freebsd.32.exp +++ b/druntime/test/profile/myprofilegc.log.freebsd.32.exp @@ -14,8 +14,6 @@ bytes allocated, allocations, type, function, file:line 16 1 float profilegc.main src/profilegc.d:17 16 1 int profilegc.main src/profilegc.d:13 16 1 int profilegc.main src/profilegc.d:14 - 16 1 uint[] profilegc.main src/profilegc.d:15 - 16 1 uint[] profilegc.main src/profilegc.d:18 16 1 int[] profilegc.main src/profilegc.d:22 16 1 int[] profilegc.main src/profilegc.d:37 16 1 wchar[] profilegc.main src/profilegc.d:35 diff --git a/druntime/test/profile/myprofilegc.log.freebsd.64.exp b/druntime/test/profile/myprofilegc.log.freebsd.64.exp index 97c1aaa253..7cc4c6de66 100644 --- a/druntime/test/profile/myprofilegc.log.freebsd.64.exp +++ b/druntime/test/profile/myprofilegc.log.freebsd.64.exp @@ -6,8 +6,6 @@ bytes allocated, allocations, type, function, file:line 48 1 float[] profilegc.main src/profilegc.d:42 48 1 int[] profilegc.main src/profilegc.d:41 32 1 C profilegc.main src/profilegc.d:12 - 32 1 ulong[] profilegc.main src/profilegc.d:15 - 32 1 ulong[] profilegc.main src/profilegc.d:18 32 1 void[] profilegc.main src/profilegc.d:55 16 1 char[] profilegc.main src/profilegc.d:34 16 1 char[] profilegc.main src/profilegc.d:36 diff --git a/druntime/test/profile/myprofilegc.log.linux.32.exp b/druntime/test/profile/myprofilegc.log.linux.32.exp index 2dc8e5ccf3..c610fbdbd7 100644 --- a/druntime/test/profile/myprofilegc.log.linux.32.exp +++ b/druntime/test/profile/myprofilegc.log.linux.32.exp @@ -16,6 +16,4 @@ bytes allocated, allocations, type, function, file:line 16 1 int profilegc.main src/profilegc.d:14 16 1 int[] profilegc.main src/profilegc.d:22 16 1 int[] profilegc.main src/profilegc.d:37 - 16 1 uint[] profilegc.main src/profilegc.d:15 - 16 1 uint[] profilegc.main src/profilegc.d:18 16 1 wchar[] profilegc.main src/profilegc.d:35 diff --git a/druntime/test/profile/myprofilegc.log.linux.64.exp b/druntime/test/profile/myprofilegc.log.linux.64.exp index 97c1aaa253..7cc4c6de66 100644 --- a/druntime/test/profile/myprofilegc.log.linux.64.exp +++ b/druntime/test/profile/myprofilegc.log.linux.64.exp @@ -6,8 +6,6 @@ bytes allocated, allocations, type, function, file:line 48 1 float[] profilegc.main src/profilegc.d:42 48 1 int[] profilegc.main src/profilegc.d:41 32 1 C profilegc.main src/profilegc.d:12 - 32 1 ulong[] profilegc.main src/profilegc.d:15 - 32 1 ulong[] profilegc.main src/profilegc.d:18 32 1 void[] profilegc.main src/profilegc.d:55 16 1 char[] profilegc.main src/profilegc.d:34 16 1 char[] profilegc.main src/profilegc.d:36 diff --git a/druntime/test/profile/myprofilegc.log.osx.32.exp b/druntime/test/profile/myprofilegc.log.osx.32.exp index 1cea04eced..e5db24779e 100644 --- a/druntime/test/profile/myprofilegc.log.osx.32.exp +++ b/druntime/test/profile/myprofilegc.log.osx.32.exp @@ -14,8 +14,6 @@ bytes allocated, allocations, type, function, file:line 16 1 float profilegc.main src/profilegc.d:17 16 1 int profilegc.main src/profilegc.d:13 16 1 int profilegc.main src/profilegc.d:14 - 16 1 uint[] profilegc.main src/profilegc.d:15 - 16 1 uint[] profilegc.main src/profilegc.d:18 16 1 int[] profilegc.main src/profilegc.d:22 16 1 int[] profilegc.main src/profilegc.d:37 16 1 wchar[] profilegc.main src/profilegc.d:35 diff --git a/druntime/test/profile/myprofilegc.log.osx.64.exp b/druntime/test/profile/myprofilegc.log.osx.64.exp index 97c1aaa253..7cc4c6de66 100644 --- a/druntime/test/profile/myprofilegc.log.osx.64.exp +++ b/druntime/test/profile/myprofilegc.log.osx.64.exp @@ -6,8 +6,6 @@ bytes allocated, allocations, type, function, file:line 48 1 float[] profilegc.main src/profilegc.d:42 48 1 int[] profilegc.main src/profilegc.d:41 32 1 C profilegc.main src/profilegc.d:12 - 32 1 ulong[] profilegc.main src/profilegc.d:15 - 32 1 ulong[] profilegc.main src/profilegc.d:18 32 1 void[] profilegc.main src/profilegc.d:55 16 1 char[] profilegc.main src/profilegc.d:34 16 1 char[] profilegc.main src/profilegc.d:36 diff --git a/druntime/test/profile/myprofilegc.log.windows.32.exp b/druntime/test/profile/myprofilegc.log.windows.32.exp index cf29c52048..91cfedb358 100644 --- a/druntime/test/profile/myprofilegc.log.windows.32.exp +++ b/druntime/test/profile/myprofilegc.log.windows.32.exp @@ -16,6 +16,4 @@ bytes allocated, allocations, type, function, file:line 16 1 int profilegc.main src\profilegc.d:14 16 1 int[] profilegc.main src\profilegc.d:22 16 1 int[] profilegc.main src\profilegc.d:37 - 16 1 uint[] profilegc.main src\profilegc.d:15 - 16 1 uint[] profilegc.main src\profilegc.d:18 16 1 wchar[] profilegc.main src\profilegc.d:35 diff --git a/druntime/test/profile/myprofilegc.log.windows.64.exp b/druntime/test/profile/myprofilegc.log.windows.64.exp index 631c404941..80fff94311 100644 --- a/druntime/test/profile/myprofilegc.log.windows.64.exp +++ b/druntime/test/profile/myprofilegc.log.windows.64.exp @@ -6,8 +6,6 @@ bytes allocated, allocations, type, function, file:line 48 1 float[] profilegc.main src\profilegc.d:42 48 1 int[] profilegc.main src\profilegc.d:41 32 1 C profilegc.main src\profilegc.d:12 - 32 1 ulong[] profilegc.main src\profilegc.d:15 - 32 1 ulong[] profilegc.main src\profilegc.d:18 32 1 void[] profilegc.main src\profilegc.d:55 16 1 char[] profilegc.main src\profilegc.d:34 16 1 char[] profilegc.main src\profilegc.d:36