Fix uninitialized memory use in sampler_test

Sampler's documentation states the following:
  C++03 requires that types stored in TLS be POD.  As a result, you must
  initialize these members to {0, 0, false} before using this class!

However, the test code wasn't doing that. MemorySanitizer and
UndefinedBehaviorSanitizer both failed because of it.
This commit is contained in:
Brian Silverman 2018-07-31 15:53:47 -07:00 committed by Aliaksey Kandratsenka
parent 51a5613f21
commit 0b588e7490

View File

@ -361,7 +361,7 @@ double StandardDeviationsErrorInSample(
}
TEST(Sampler, LargeAndSmallAllocs_CombinedTest) {
tcmalloc::Sampler sampler;
tcmalloc::Sampler sampler{0, 0, false};
sampler.Init(1);
int counter_big = 0;
int counter_small = 0;