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
commit2909866fbc652492b7d7cab3023cb19489dc4fd8 (patch)
treeb222e5ac2e2e98872661c51ccceee5da0d291e13 /util/system/align.h
parentd3530b2692e400bd4d29bd4f07cafaee139164e7 (diff)
downloadydb-2909866fbc652492b7d7cab3023cb19489dc4fd8.tar.gz
Restoring authorship annotation for <agri@yandex-team.ru>. Commit 2 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 e2e2dbef79..ea0bbc5b46 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>