aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/ptr.h
diff options
context:
space:
mode:
authoragri <agri@yandex-team.ru>2022-02-10 16:48:12 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:12 +0300
commit2909866fbc652492b7d7cab3023cb19489dc4fd8 (patch)
treeb222e5ac2e2e98872661c51ccceee5da0d291e13 /util/generic/ptr.h
parentd3530b2692e400bd4d29bd4f07cafaee139164e7 (diff)
downloadydb-2909866fbc652492b7d7cab3023cb19489dc4fd8.tar.gz
Restoring authorship annotation for <agri@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/ptr.h')
-rw-r--r--util/generic/ptr.h60
1 files changed, 30 insertions, 30 deletions
diff --git a/util/generic/ptr.h b/util/generic/ptr.h
index fd1cd162b1..19db0e3ec5 100644
--- a/util/generic/ptr.h
+++ b/util/generic/ptr.h
@@ -366,19 +366,19 @@ public:
inline ~TRefCounted() = default;
inline void Ref(TAtomicBase d) noexcept {
- auto resultCount = Counter_.Add(d);
- Y_ASSERT(resultCount >= d);
- (void)resultCount;
+ auto resultCount = Counter_.Add(d);
+ Y_ASSERT(resultCount >= d);
+ (void)resultCount;
}
inline void Ref() noexcept {
- auto resultCount = Counter_.Inc();
- Y_ASSERT(resultCount != 0);
- (void)resultCount;
+ auto resultCount = Counter_.Inc();
+ Y_ASSERT(resultCount != 0);
+ (void)resultCount;
}
inline void UnRef(TAtomicBase d) noexcept {
- auto resultCount = Counter_.Sub(d);
+ auto resultCount = Counter_.Sub(d);
Y_ASSERT(resultCount >= 0);
if (resultCount == 0) {
D::Destroy(static_cast<T*>(this));
@@ -389,14 +389,14 @@ public:
UnRef(1);
}
- inline TAtomicBase RefCount() const noexcept {
+ inline TAtomicBase RefCount() const noexcept {
return Counter_.Val();
}
inline void DecRef() noexcept {
- auto resultCount = Counter_.Dec();
- Y_ASSERT(resultCount >= 0);
- (void)resultCount;
+ auto resultCount = Counter_.Dec();
+ Y_ASSERT(resultCount >= 0);
+ (void)resultCount;
}
TRefCounted(const TRefCounted&)
@@ -543,11 +543,11 @@ public:
return *this;
}
- // Effectively replace both:
- // Reset(const TIntrusivePtr&)
- // Reset(TIntrusivePtr&&)
- inline void Reset(TIntrusivePtr t) noexcept {
- Swap(t);
+ // Effectively replace both:
+ // Reset(const TIntrusivePtr&)
+ // Reset(TIntrusivePtr&&)
+ inline void Reset(TIntrusivePtr t) noexcept {
+ Swap(t);
}
inline void Reset() noexcept {
@@ -663,11 +663,11 @@ public:
return *this;
}
- // Effectively replace both:
- // Reset(const TIntrusiveConstPtr&)
- // Reset(TIntrusiveConstPtr&&)
- inline void Reset(TIntrusiveConstPtr t) noexcept {
- Swap(t);
+ // Effectively replace both:
+ // Reset(const TIntrusiveConstPtr&)
+ // Reset(TIntrusiveConstPtr&&)
+ inline void Reset(TIntrusiveConstPtr t) noexcept {
+ Swap(t);
}
inline void Reset() noexcept {
@@ -783,11 +783,11 @@ template <typename T, class Ops = TDefaultIntrusivePtrOps<T>, typename... Args>
return new T{std::forward<Args>(args)...};
}
-template <typename T, class Ops = TDefaultIntrusivePtrOps<T>, typename... Args>
+template <typename T, class Ops = TDefaultIntrusivePtrOps<T>, typename... Args>
[[nodiscard]] TIntrusiveConstPtr<T, Ops> MakeIntrusiveConst(Args&&... args) {
- return new T{std::forward<Args>(args)...};
-}
-
+ return new T{std::forward<Args>(args)...};
+}
+
template <class T, class C, class D>
class TSharedPtr: public TPointerBase<TSharedPtr<T, C, D>, T> {
template <class TT, class CC, class DD>
@@ -862,11 +862,11 @@ public:
return *this;
}
- // Effectively replace both:
- // Reset(const TSharedPtr& t)
- // Reset(TSharedPtr&& t)
- inline void Reset(TSharedPtr t) noexcept {
- Swap(t);
+ // Effectively replace both:
+ // Reset(const TSharedPtr& t)
+ // Reset(TSharedPtr&& t)
+ inline void Reset(TSharedPtr t) noexcept {
+ Swap(t);
}
inline void Reset() noexcept {