Skip to content

Commit

Permalink
PerfContext* init_perf_context() noexcept
Browse files Browse the repository at this point in the history
  • Loading branch information
rockeet committed May 6, 2023
1 parent 146441d commit 6b10eab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion monitoring/perf_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<PerfContext> 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);
Expand Down
2 changes: 1 addition & 1 deletion monitoring/perf_context_imp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6b10eab

Please sign in to comment.