aboutsummaryrefslogtreecommitdiffstats
path: root/util/memory/pool.h
diff options
context:
space:
mode:
authorsmalov <smalov@yandex-team.ru>2022-02-10 16:47:36 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:36 +0300
commitcfadda92ca195da3ad68d721a58872a4f1ced696 (patch)
treec0748b5dcbade83af788c0abfa89c0383d6b779c /util/memory/pool.h
parentf70d9720e13aef3a935e3f405b0eac554529e76e (diff)
downloadydb-cfadda92ca195da3ad68d721a58872a4f1ced696.tar.gz
Restoring authorship annotation for <smalov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/memory/pool.h')
-rw-r--r--util/memory/pool.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/util/memory/pool.h b/util/memory/pool.h
index d24b9fdd85..13c8b6b9ed 100644
--- a/util/memory/pool.h
+++ b/util/memory/pool.h
@@ -360,12 +360,12 @@ public:
using size_type = size_t;
using difference_type = ptrdiff_t;
using value_type = T;
-
+
inline TPoolAllocBase(TPool* pool)
: Pool_(pool)
{
}
-
+
template <typename TOther>
inline TPoolAllocBase(const TPoolAllocBase<TOther, TPool>& o)
: Pool_(o.GetPool())
@@ -375,29 +375,29 @@ public:
inline T* allocate(size_t n) {
return (T*)Pool_->Allocate(n * sizeof(T), alignof(T));
}
-
+
inline void deallocate(pointer /*p*/, size_t /*n*/) {
}
-
+
template <class T1>
struct rebind {
using other = TPoolAllocBase<T1, TPool>;
};
-
+
inline size_type max_size() const noexcept {
return size_type(-1) / sizeof(T);
}
-
+
template <typename... Args>
inline void construct(pointer p, Args&&... args) {
new (p) T(std::forward<Args>(args)...);
}
-
+
inline void destroy(pointer p) noexcept {
(void)p; /* Make MSVC happy. */
p->~T();
}
-
+
inline TPool* GetPool() const {
return Pool_;
}
@@ -412,20 +412,20 @@ public:
private:
TPool* Pool_;
-};
-
+};
+
template <class T>
using TPoolAlloc = TPoolAllocBase<T, TMemoryPool>;
// Any type since it is supposed to be rebound anyway.
using TPoolAllocator = TPoolAlloc<int>;
-
-template <class T>
+
+template <class T>
inline bool operator==(const TPoolAlloc<T>&, const TPoolAlloc<T>&) noexcept {
- return true;
-}
-
-template <class T>
+ return true;
+}
+
+template <class T>
inline bool operator!=(const TPoolAlloc<T>&, const TPoolAlloc<T>&) noexcept {
- return false;
-}
+ return false;
+}