From 47a81fc126004a876ccb456a1c867f3d33f84eed Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Wed, 11 Jan 2023 20:00:55 +0000 Subject: [PATCH] tint/utils: Use a C-array instead of std::array std::array unnecessarily zeros the memory, which shows up in profiles Change-Id: I2a18ef4fb8ca46bc6fc87504858046d9b7d2fd45 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116866 Commit-Queue: Ben Clayton Reviewed-by: Antonio Maiorano Kokoro: Kokoro --- src/tint/utils/vector.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tint/utils/vector.h b/src/tint/utils/vector.h index 83e1c12197..cca2409f7b 100644 --- a/src/tint/utils/vector.h +++ b/src/tint/utils/vector.h @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -592,7 +591,7 @@ class Vector { /// The internal structure for the vector with a small array. struct ImplWithSmallArray { - std::array small_arr; + TStorage small_arr[N]; Slice slice = {small_arr[0].Get(), 0, N}; /// Allocates a new vector of `T` either from #small_arr, or from the heap, then assigns the