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 <bclayton@google.com> Reviewed-by: Antonio Maiorano <amaiorano@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
parent
7cc9bcd1a9
commit
47a81fc126
|
@ -18,7 +18,6 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <array>
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
@ -592,7 +591,7 @@ class Vector {
|
||||||
|
|
||||||
/// The internal structure for the vector with a small array.
|
/// The internal structure for the vector with a small array.
|
||||||
struct ImplWithSmallArray {
|
struct ImplWithSmallArray {
|
||||||
std::array<TStorage, N> small_arr;
|
TStorage small_arr[N];
|
||||||
Slice slice = {small_arr[0].Get(), 0, 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
|
/// Allocates a new vector of `T` either from #small_arr, or from the heap, then assigns the
|
||||||
|
|
Loading…
Reference in New Issue