aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/align.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
commitd3530b2692e400bd4d29bd4f07cafaee139164e7 (patch)
treeb7ae636a74490e649a2ed0fdd5361f1bec83b9f9 /util/system/align.h
parent0f4c5d1e8c0672bf0a1f2f2d8acac5ba24772435 (diff)
downloadydb-d3530b2692e400bd4d29bd4f07cafaee139164e7.tar.gz
Restoring authorship annotation for <agri@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system/align.h')
-rw-r--r--util/system/align.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/util/system/align.h b/util/system/align.h
index ea0bbc5b466..e2e2dbef794 100644
--- a/util/system/align.h
+++ b/util/system/align.h
@@ -2,19 +2,19 @@
#include "yassert.h"
#include "defaults.h"
-#include <util/generic/bitops.h>
+#include <util/generic/bitops.h>
template <class T>
static inline T AlignDown(T len, T align) noexcept {
- Y_ASSERT(IsPowerOf2(align)); // align should be power of 2
+ Y_ASSERT(IsPowerOf2(align)); // align should be power of 2
return len & ~(align - 1);
}
template <class T>
static inline T AlignUp(T len, T align) noexcept {
- const T alignedResult = AlignDown(len + (align - 1), align);
- Y_ASSERT(alignedResult >= len); // check for overflow
- return alignedResult;
+ const T alignedResult = AlignDown(len + (align - 1), align);
+ Y_ASSERT(alignedResult >= len); // check for overflow
+ return alignedResult;
}
template <class T>
@@ -25,12 +25,12 @@ static inline T AlignUpSpace(T len, T align) noexcept {
template <class T>
static inline T* AlignUp(T* ptr, size_t align) noexcept {
- return (T*)AlignUp((uintptr_t)ptr, align);
+ return (T*)AlignUp((uintptr_t)ptr, align);
}
template <class T>
static inline T* AlignDown(T* ptr, size_t align) noexcept {
- return (T*)AlignDown((uintptr_t)ptr, align);
+ return (T*)AlignDown((uintptr_t)ptr, align);
}
template <class T>