aboutsummaryrefslogtreecommitdiffstats
path: root/util/memory/pool.h
diff options
context:
space:
mode:
authoraosipenko <aosipenko@yandex-team.ru>2022-02-10 16:48:08 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:08 +0300
commit948fd24d47d4b3b7815aaef1686aea00ef3f4288 (patch)
tree8ad4c39c2a5f8b341bc02e3b0c5e8f26c40373cb /util/memory/pool.h
parentd2eb4aae699fa2f6901bf32d22eec019c8f29838 (diff)
downloadydb-948fd24d47d4b3b7815aaef1686aea00ef3f4288.tar.gz
Restoring authorship annotation for <aosipenko@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/memory/pool.h')
-rw-r--r--util/memory/pool.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/util/memory/pool.h b/util/memory/pool.h
index 13c8b6b9ed..da1b544c37 100644
--- a/util/memory/pool.h
+++ b/util/memory/pool.h
@@ -159,7 +159,7 @@ public:
inline T* Allocate() {
return (T*)this->Allocate(sizeof(T), alignof(T));
}
-
+
template <typename T>
inline T* Allocate(size_t align) {
return (T*)this->Allocate(sizeof(T), Max(align, alignof(T)));
@@ -175,20 +175,20 @@ public:
return (T*)this->Allocate(sizeof(T) * count, Max(align, alignof(T)));
}
- template <typename T>
- inline T* AllocateZeroArray(size_t count) {
- T* ptr = AllocateArray<T>(count);
- memset(ptr, 0, count * sizeof(T));
- return ptr;
- }
-
- template <typename T>
- inline T* AllocateZeroArray(size_t count, size_t align) {
- T* ptr = AllocateArray<T>(count, align);
- memset(ptr, 0, count * sizeof(T));
- return ptr;
- }
-
+ template <typename T>
+ inline T* AllocateZeroArray(size_t count) {
+ T* ptr = AllocateArray<T>(count);
+ memset(ptr, 0, count * sizeof(T));
+ return ptr;
+ }
+
+ template <typename T>
+ inline T* AllocateZeroArray(size_t count, size_t align) {
+ T* ptr = AllocateArray<T>(count, align);
+ memset(ptr, 0, count * sizeof(T));
+ return ptr;
+ }
+
template <typename T, typename... Args>
inline T* New(Args&&... args) {
return new (Allocate<T>()) T(std::forward<Args>(args)...);