diff --git a/libraries/AP_HAL_Linux/Perf.cpp b/libraries/AP_HAL_Linux/Perf.cpp index 1e12a9ff5b..274b02108c 100644 --- a/libraries/AP_HAL_Linux/Perf.cpp +++ b/libraries/AP_HAL_Linux/Perf.cpp @@ -35,7 +35,7 @@ using namespace Linux; static const AP_HAL::HAL &hal = AP_HAL::get_HAL(); -Perf *Perf::_instance; +Perf *Perf::_singleton; static inline uint64_t now_nsec() { @@ -44,13 +44,13 @@ static inline uint64_t now_nsec() return ts.tv_nsec + (ts.tv_sec * AP_NSEC_PER_SEC); } -Perf *Perf::get_instance() +Perf *Perf::get_singleton() { - if (!_instance) { - _instance = new Perf(); + if (!_singleton) { + _singleton = new Perf(); } - return _instance; + return _singleton; } void Perf::_debug_counters() diff --git a/libraries/AP_HAL_Linux/Perf.h b/libraries/AP_HAL_Linux/Perf.h index 28cdce0d43..5f74332769 100644 --- a/libraries/AP_HAL_Linux/Perf.h +++ b/libraries/AP_HAL_Linux/Perf.h @@ -64,7 +64,7 @@ class Perf { public: ~Perf(); - static Perf *get_instance(); + static Perf *get_singleton(); perf_counter_t add(perf_counter_type type, const char *name); @@ -75,7 +75,7 @@ public: unsigned int get_update_count() { return _update_count; } private: - static Perf *_instance; + static Perf *_singleton; Perf(); diff --git a/libraries/AP_HAL_Linux/Util.h b/libraries/AP_HAL_Linux/Util.h index 705706d32c..373054d78f 100644 --- a/libraries/AP_HAL_Linux/Util.h +++ b/libraries/AP_HAL_Linux/Util.h @@ -75,22 +75,22 @@ public: perf_counter_t perf_alloc(enum perf_counter_type t, const char *name) override { - return Perf::get_instance()->add(t, name); + return Perf::get_singleton()->add(t, name); } void perf_begin(perf_counter_t perf) override { - return Perf::get_instance()->begin(perf); + return Perf::get_singleton()->begin(perf); } void perf_end(perf_counter_t perf) override { - return Perf::get_instance()->end(perf); + return Perf::get_singleton()->end(perf); } void perf_count(perf_counter_t perf) override { - return Perf::get_instance()->count(perf); + return Perf::get_singleton()->count(perf); } int get_hw_arm32();