diff --git a/monitoring/perf_context.cc b/monitoring/perf_context.cc index 78f35eda0..0a430b43f 100644 --- a/monitoring/perf_context.cc +++ b/monitoring/perf_context.cc @@ -18,7 +18,7 @@ PerfContext perf_context; ROCKSDB_STATIC_TLS ROCKSDB_RAW_TLS PerfContext* p_perf_context; // not need ROCKSDB_STATIC_TLS static thread_local std::unique_ptr g_del_perf_context; - PerfContext* init_perf_context() { + PerfContext* init_perf_context() noexcept { // tls is always init at first use, this function is a must auto ptr = p_perf_context = new PerfContext; g_del_perf_context.reset(ptr); diff --git a/monitoring/perf_context_imp.h b/monitoring/perf_context_imp.h index ad167c309..9d15169c9 100644 --- a/monitoring/perf_context_imp.h +++ b/monitoring/perf_context_imp.h @@ -17,7 +17,7 @@ extern PerfContext perf_context; extern thread_local PerfContext perf_context_; #define perf_context (*get_perf_context()) #else - extern PerfContext* init_perf_context(); + extern PerfContext* init_perf_context() noexcept; extern ROCKSDB_STATIC_TLS ROCKSDB_RAW_TLS PerfContext* p_perf_context; #define perf_context (*(p_perf_context?:init_perf_context())) #endif