Skip to content

Commit

Permalink
build: do not use memset in BufferPerfTest
Browse files Browse the repository at this point in the history
The test uses arrays of std::tuple and its inheritants and clears them
with memset. It is allowed only if the type has trivial copy constructor,
and std::tuple has not. So let's implicitly initialize members of arrays
with default value.
  • Loading branch information
drewdzzz committed Oct 17, 2023
1 parent 2dcb361 commit 2916ff3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/BufferPerfTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ bench(T (&in)[N], T (&out)[N])
std::cout << "---------------------------------------" << std::endl;
std::cout << "Bench of " << contName(cont) << (LIGHT ? " (light)" : "")
<< " with " << dataName(in[0]) << std::endl;
memset(out, 0, sizeof(out));
for (size_t i = 0; i < N; i++)
out[i] = T();
PerfTimer timer;

// Write
Expand Down

0 comments on commit 2916ff3

Please sign in to comment.