aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/object_counter.h
diff options
context:
space:
mode:
authorAlexander Fokin <apfokin@gmail.com>2022-02-10 16:45:38 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:38 +0300
commitbf9e69a933f89af083d895185f01ed65e4d90766 (patch)
treeb2cc84ee7850122e7ccf51d0ea21e4fa7e7a5685 /util/generic/object_counter.h
parent863a59a65247c24db7cb06789bc5cf79d04da32f (diff)
downloadydb-bf9e69a933f89af083d895185f01ed65e4d90766.tar.gz
Restoring authorship annotation for Alexander Fokin <apfokin@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'util/generic/object_counter.h')
-rw-r--r--util/generic/object_counter.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/util/generic/object_counter.h b/util/generic/object_counter.h
index 9b0710e971..5257afa2e6 100644
--- a/util/generic/object_counter.h
+++ b/util/generic/object_counter.h
@@ -2,20 +2,20 @@
#include <util/system/atomic.h>
-/**
- * Simple thread-safe per-class counter that can be used to make sure you don't
- * have any leaks in your code, or for statistical purposes.
- *
- * Example usage:
- * \code
- * class TMyClass: public TObjectCounter<TMyClass> {
- * // ...
- * };
- *
- * // In your code:
- * Cerr << "TMyClass instances in use: " << TMyClass::ObjectCount() << Endl;
- * \endcode
- */
+/**
+ * Simple thread-safe per-class counter that can be used to make sure you don't
+ * have any leaks in your code, or for statistical purposes.
+ *
+ * Example usage:
+ * \code
+ * class TMyClass: public TObjectCounter<TMyClass> {
+ * // ...
+ * };
+ *
+ * // In your code:
+ * Cerr << "TMyClass instances in use: " << TMyClass::ObjectCount() << Endl;
+ * \endcode
+ */
template <class T>
class TObjectCounter {
public:
@@ -35,12 +35,12 @@ public:
return AtomicGet(Count_);
}
- /**
- * Resets object count. Mainly for tests, as you don't want to do this in
- * your code and then end up with negative counts.
- *
- * \returns Current object count.
- */
+ /**
+ * Resets object count. Mainly for tests, as you don't want to do this in
+ * your code and then end up with negative counts.
+ *
+ * \returns Current object count.
+ */
static inline long ResetObjectCount() noexcept {
return AtomicSwap(&Count_, 0);
}