diff options
author | swarmer <swarmer@yandex-team.ru> | 2022-02-10 16:46:31 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:31 +0300 |
commit | 317da38588b7898a99fd9168571408123350012b (patch) | |
tree | 25eebc31526019ad39a6c1b13f492963d97ba439 /library/cpp/containers | |
parent | 3b2241461d41d41ba1a706b0750c4f0f55c344f6 (diff) | |
download | ydb-317da38588b7898a99fd9168571408123350012b.tar.gz |
Restoring authorship annotation for <swarmer@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/containers')
-rw-r--r-- | library/cpp/containers/bitseq/traits.h | 6 | ||||
-rw-r--r-- | library/cpp/containers/stack_vector/stack_vec.h | 12 | ||||
-rw-r--r-- | library/cpp/containers/stack_vector/stack_vec_ut.cpp | 32 |
3 files changed, 25 insertions, 25 deletions
diff --git a/library/cpp/containers/bitseq/traits.h b/library/cpp/containers/bitseq/traits.h index 2330b1b4f2..a852ea8d40 100644 --- a/library/cpp/containers/bitseq/traits.h +++ b/library/cpp/containers/bitseq/traits.h @@ -6,9 +6,9 @@ template <typename TWord> struct TBitSeqTraits { - static constexpr ui8 NumBits = CHAR_BIT * sizeof(TWord); - static constexpr TWord ModMask = static_cast<TWord>(NumBits - 1); - static constexpr TWord DivShift = MostSignificantBitCT(NumBits); + static constexpr ui8 NumBits = CHAR_BIT * sizeof(TWord); + static constexpr TWord ModMask = static_cast<TWord>(NumBits - 1); + static constexpr TWord DivShift = MostSignificantBitCT(NumBits); static inline TWord ElemMask(ui8 count) { // NOTE: Shifting by the type's length is UB, so we need this workaround. diff --git a/library/cpp/containers/stack_vector/stack_vec.h b/library/cpp/containers/stack_vector/stack_vec.h index fcc5d9a2a5..42e46e23f2 100644 --- a/library/cpp/containers/stack_vector/stack_vec.h +++ b/library/cpp/containers/stack_vector/stack_vec.h @@ -76,18 +76,18 @@ namespace NPrivate { Y_VERIFY(IsStorageUsed); IsStorageUsed = false; } else { - FallbackAllocator().deallocate(p, n); + FallbackAllocator().deallocate(p, n); } } private: std::aligned_storage_t<sizeof(T), alignof(T)> StackBasedStorage[CountOnStack]; bool IsStorageUsed = false; - - private: - Alloc& FallbackAllocator() noexcept { - return static_cast<Alloc&>(*this); - } + + private: + Alloc& FallbackAllocator() noexcept { + return static_cast<Alloc&>(*this); + } }; } diff --git a/library/cpp/containers/stack_vector/stack_vec_ut.cpp b/library/cpp/containers/stack_vector/stack_vec_ut.cpp index 19f9677781..bdb66f8c4f 100644 --- a/library/cpp/containers/stack_vector/stack_vec_ut.cpp +++ b/library/cpp/containers/stack_vector/stack_vec_ut.cpp @@ -9,16 +9,16 @@ namespace { static_assert(std::is_copy_constructible_v<TNotCopyAssignable>); static_assert(!std::is_copy_assignable_v<TNotCopyAssignable>); - - template <class T, size_t JunkPayloadSize> - struct TThickAlloc: public std::allocator<T> { - template <class U> - struct rebind { - using other = TThickAlloc<U, JunkPayloadSize>; - }; - - char Junk[JunkPayloadSize]{sizeof(T)}; - }; + + template <class T, size_t JunkPayloadSize> + struct TThickAlloc: public std::allocator<T> { + template <class U> + struct rebind { + using other = TThickAlloc<U, JunkPayloadSize>; + }; + + char Junk[JunkPayloadSize]{sizeof(T)}; + }; template <class T> struct TStatefulAlloc: public std::allocator<T> { @@ -126,12 +126,12 @@ Y_UNIT_TEST_SUITE(TStackBasedVectorTest) { } // Just verify that the program did not crash. } - - Y_UNIT_TEST(TestCustomAllocSize) { - constexpr size_t n = 16384; - using TVec = TStackVec<size_t, 1, true, TThickAlloc<size_t, n>>; - UNIT_ASSERT_LT(sizeof(TVec), 1.5 * n); - } + + Y_UNIT_TEST(TestCustomAllocSize) { + constexpr size_t n = 16384; + using TVec = TStackVec<size_t, 1, true, TThickAlloc<size_t, n>>; + UNIT_ASSERT_LT(sizeof(TVec), 1.5 * n); + } Y_UNIT_TEST(TestStatefulAlloc) { size_t count = 0; |