提交 b1031d6c 编写于 作者: D Dmitri Smirnov 提交者: yiwu-arbug

Remove function local statics that interfere with memory pooling (#1392)

上级 f4705401
......@@ -26,6 +26,8 @@
namespace rocksdb {
const std::string kNullptrString = "nullptr";
DBOptions BuildDBOptions(const ImmutableDBOptions& immutable_db_options,
const MutableDBOptions& mutable_db_options) {
DBOptions options;
......@@ -451,7 +453,7 @@ bool ParseSliceTransformHelper(
const std::string& kFixedPrefixName, const std::string& kCappedPrefixName,
const std::string& value,
std::shared_ptr<const SliceTransform>* slice_transform) {
static const std::string kNullptrString = "nullptr";
auto& pe_value = value;
if (pe_value.size() > kFixedPrefixName.size() &&
pe_value.compare(0, kFixedPrefixName.size(), kFixedPrefixName) == 0) {
......@@ -577,7 +579,7 @@ bool ParseOptionHelper(char* opt_address, const OptionType& opt_type,
bool SerializeSingleOptionHelper(const char* opt_address,
const OptionType opt_type,
std::string* value) {
static const std::string kNullptrString = "nullptr";
assert(value);
switch (opt_type) {
case OptionType::kBoolean:
......
......@@ -693,6 +693,7 @@ static std::unordered_map<std::string, InfoLogLevel> info_log_level_string_map =
{"FATAL_LEVEL", InfoLogLevel::FATAL_LEVEL},
{"HEADER_LEVEL", InfoLogLevel::HEADER_LEVEL}};
extern const std::string kNullptrString;
#endif // !ROCKSDB_LITE
} // namespace rocksdb
......
......@@ -510,7 +510,7 @@ bool AreEqualOptions(
const std::unordered_map<std::string, std::string>* opt_map) {
const char* offset1 = opt1 + type_info.offset;
const char* offset2 = opt2 + type_info.offset;
static const std::string kNullptrString = "nullptr";
switch (type_info.type) {
case OptionType::kBoolean:
return (*reinterpret_cast<const bool*>(offset1) ==
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册