mirror of
https://github.com/gperftools/gperftools
synced 2025-01-18 12:51:02 +00:00
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:
parent
51a5613f21
commit
0b588e7490
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user