aboutsummaryrefslogtreecommitdiffstats
path: root/util/memory
diff options
context:
space:
mode:
authorAndrey Khalyavin <halyavin@gmail.com>2022-02-10 16:46:30 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:30 +0300
commit4b839d0704ee9be1dabb0310a1f03af24963637b (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/memory
parentf773626848a7c7456803654292e716b83d69cc12 (diff)
downloadydb-4b839d0704ee9be1dabb0310a1f03af24963637b.tar.gz
Restoring authorship annotation for Andrey Khalyavin <halyavin@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'util/memory')
-rw-r--r--util/memory/alloc.h2
-rw-r--r--util/memory/pool.h6
-rw-r--r--util/memory/segpool_alloc.h4
-rw-r--r--util/memory/smallobj.h24
4 files changed, 18 insertions, 18 deletions
diff --git a/util/memory/alloc.h b/util/memory/alloc.h
index 36367a7eef..d59575aef5 100644
--- a/util/memory/alloc.h
+++ b/util/memory/alloc.h
@@ -3,7 +3,7 @@
#include <memory>
template <class Allocator, class T>
-using TReboundAllocator = typename std::allocator_traits<Allocator>::template rebind_alloc<T>;
+using TReboundAllocator = typename std::allocator_traits<Allocator>::template rebind_alloc<T>;
class IAllocator {
public:
diff --git a/util/memory/pool.h b/util/memory/pool.h
index 626bee0ddd..13c8b6b9ed 100644
--- a/util/memory/pool.h
+++ b/util/memory/pool.h
@@ -212,7 +212,7 @@ public:
template <typename TChar>
inline TChar* Append(const TChar* str, size_t len) {
- TChar* ret = AllocateArray<TChar>(len);
+ TChar* ret = AllocateArray<TChar>(len);
std::char_traits<TChar>::copy(ret, str, len);
return ret;
@@ -417,8 +417,8 @@ private:
template <class T>
using TPoolAlloc = TPoolAllocBase<T, TMemoryPool>;
-// Any type since it is supposed to be rebound anyway.
-using TPoolAllocator = TPoolAlloc<int>;
+// Any type since it is supposed to be rebound anyway.
+using TPoolAllocator = TPoolAlloc<int>;
template <class T>
inline bool operator==(const TPoolAlloc<T>&, const TPoolAlloc<T>&) noexcept {
diff --git a/util/memory/segpool_alloc.h b/util/memory/segpool_alloc.h
index fa3ea7d90d..1a83b7a543 100644
--- a/util/memory/segpool_alloc.h
+++ b/util/memory/segpool_alloc.h
@@ -114,5 +114,5 @@ inline bool operator!=(const segpool_alloc<_Tp>& a1, const segpool_alloc<_Tp>& a
return a1.pool != a2.pool;
}
-// Any type since it is supposed to be rebound anyway.
-using segpool_alloc_vt = segpool_alloc<int>;
+// Any type since it is supposed to be rebound anyway.
+using segpool_alloc_vt = segpool_alloc<int>;
diff --git a/util/memory/smallobj.h b/util/memory/smallobj.h
index cb0490ab31..63de666bae 100644
--- a/util/memory/smallobj.h
+++ b/util/memory/smallobj.h
@@ -107,17 +107,17 @@ private:
template <class T>
class TObjectFromPool {
public:
- struct THeader {
- void* Pool;
- // Can't just use T because THeader must be standard layout type for offsetof to work.
- alignas(T) char Obj[sizeof(T)];
- };
- using TPool = TSmallObjAllocator<THeader>;
+ struct THeader {
+ void* Pool;
+ // Can't just use T because THeader must be standard layout type for offsetof to work.
+ alignas(T) char Obj[sizeof(T)];
+ };
+ using TPool = TSmallObjAllocator<THeader>;
inline void* operator new(size_t, TPool* pool) {
- THeader* ret = pool->Allocate();
- ret->Pool = pool;
- return &ret->Obj;
+ THeader* ret = pool->Allocate();
+ ret->Pool = pool;
+ return &ret->Obj;
}
inline void operator delete(void* ptr, size_t) noexcept {
@@ -134,8 +134,8 @@ public:
private:
static inline void DoDelete(void* ptr) noexcept {
- static_assert(std::is_standard_layout<THeader>::value, "offsetof is only defined for standard layout types");
- THeader* header = (THeader*)((char*)ptr - offsetof(THeader, Obj));
- ((TPool*)header->Pool)->Release(header);
+ static_assert(std::is_standard_layout<THeader>::value, "offsetof is only defined for standard layout types");
+ THeader* header = (THeader*)((char*)ptr - offsetof(THeader, Obj));
+ ((TPool*)header->Pool)->Release(header);
}
};