Initialize two members in PerfContext (#4859)

Summary:
as titled.
Currently it's possible to create a local object of type PerfContext since it's
part of public API. Then it's safe to initialize the two members to 0.
If PerfContext is created as thread-local object, then all members are
zero-initialized according to C++ standard.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4859

Differential Revision: D13614504

Pulled By: riversand963

fbshipit-source-id: 406ff548e105a074f379ad1054d56fece5f524a0
This commit is contained in:
Yanqin Jin 2019-01-09 15:51:02 -08:00 committed by Facebook Github Bot
parent ffc9f84649
commit 75714b4c08

View File

@ -211,8 +211,8 @@ struct PerfContext {
uint64_t get_cpu_nanos;
std::map<uint32_t, PerfContextByLevel>* level_to_perf_context;
bool per_level_perf_context_enabled;
std::map<uint32_t, PerfContextByLevel>* level_to_perf_context = nullptr;
bool per_level_perf_context_enabled = false;
};
// Get Thread-local PerfContext object pointer