diff options
author | Andrey Khalyavin <halyavin@gmail.com> | 2022-02-10 16:46:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:30 +0300 |
commit | 4b839d0704ee9be1dabb0310a1f03af24963637b (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/actors | |
parent | f773626848a7c7456803654292e716b83d69cc12 (diff) | |
download | ydb-4b839d0704ee9be1dabb0310a1f03af24963637b.tar.gz |
Restoring authorship annotation for Andrey Khalyavin <halyavin@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/actors')
5 files changed, 12 insertions, 12 deletions
diff --git a/library/cpp/actors/interconnect/event_holder_pool.h b/library/cpp/actors/interconnect/event_holder_pool.h index 90ce486e9e..b6090a3bc8 100644 --- a/library/cpp/actors/interconnect/event_holder_pool.h +++ b/library/cpp/actors/interconnect/event_holder_pool.h @@ -12,12 +12,12 @@ namespace NActors { std::list<TEventHolder> FreeQueue; TStackVec<THolder<IEventBase>, MaxEvents> Events; TStackVec<THolder<TEventSerializedData>, MaxEvents> Buffers; - std::shared_ptr<std::atomic<TAtomicBase>> Counter; + std::shared_ptr<std::atomic<TAtomicBase>> Counter; ui64 NumBytes = 0; ~TEvFreeItems() { if (Counter) { - TAtomicBase res = Counter->fetch_sub(NumBytes) - NumBytes; + TAtomicBase res = Counter->fetch_sub(NumBytes) - NumBytes; Y_VERIFY(res >= 0); } } @@ -26,8 +26,8 @@ namespace NActors { Y_VERIFY(!Counter); const auto& counter = common->DestructorQueueSize; const auto& max = common->MaxDestructorQueueSize; - if (counter && (TAtomicBase)(counter->fetch_add(NumBytes) + NumBytes) > max) { - counter->fetch_sub(NumBytes); + if (counter && (TAtomicBase)(counter->fetch_add(NumBytes) + NumBytes) > max) { + counter->fetch_sub(NumBytes); return false; } Counter = counter; diff --git a/library/cpp/actors/interconnect/interconnect_common.h b/library/cpp/actors/interconnect/interconnect_common.h index 73b94931a8..285709a00c 100644 --- a/library/cpp/actors/interconnect/interconnect_common.h +++ b/library/cpp/actors/interconnect/interconnect_common.h @@ -13,8 +13,8 @@ #include "logging.h" #include "event_filter.h" -#include <atomic> - +#include <atomic> + namespace NActors { enum class EEncryptionMode { DISABLED, // no encryption is required at all @@ -78,7 +78,7 @@ namespace NActors { TInterconnectSettings Settings; TRegisterMonPageCallback RegisterMonPage; TActorId DestructorId; - std::shared_ptr<std::atomic<TAtomicBase>> DestructorQueueSize; + std::shared_ptr<std::atomic<TAtomicBase>> DestructorQueueSize; TAtomicBase MaxDestructorQueueSize = 1024 * 1024 * 1024; TString ClusterUUID; TVector<TString> AcceptUUID; diff --git a/library/cpp/actors/interconnect/ut/event_holder_pool_ut.cpp b/library/cpp/actors/interconnect/ut/event_holder_pool_ut.cpp index 5686d50590..e6b2bd4e4c 100644 --- a/library/cpp/actors/interconnect/ut/event_holder_pool_ut.cpp +++ b/library/cpp/actors/interconnect/ut/event_holder_pool_ut.cpp @@ -5,14 +5,14 @@ #include <library/cpp/monlib/dynamic_counters/counters.h> #include <library/cpp/actors/interconnect/event_holder_pool.h> -#include <atomic> - +#include <atomic> + using namespace NActors; template<typename T> TEventHolderPool Setup(T&& callback) { auto common = MakeIntrusive<TInterconnectProxyCommon>(); - common->DestructorQueueSize = std::make_shared<std::atomic<TAtomicBase>>(); + common->DestructorQueueSize = std::make_shared<std::atomic<TAtomicBase>>(); common->MaxDestructorQueueSize = 1024 * 1024; return TEventHolderPool(common, callback); } diff --git a/library/cpp/actors/util/queue_oneone_inplace.h b/library/cpp/actors/util/queue_oneone_inplace.h index 6b111968dd..d7ec8bb21c 100644 --- a/library/cpp/actors/util/queue_oneone_inplace.h +++ b/library/cpp/actors/util/queue_oneone_inplace.h @@ -5,7 +5,7 @@ template <typename T, ui32 TSize, typename TChunk = TQueueChunk<T, TSize>> class TOneOneQueueInplace : TNonCopyable { - static_assert(std::is_integral<T>::value || std::is_pointer<T>::value, "expect std::is_integral<T>::value || std::is_pointer<T>::valuer"); + static_assert(std::is_integral<T>::value || std::is_pointer<T>::value, "expect std::is_integral<T>::value || std::is_pointer<T>::valuer"); TChunk* ReadFrom; ui32 ReadPosition; diff --git a/library/cpp/actors/util/unordered_cache.h b/library/cpp/actors/util/unordered_cache.h index 80b657583a..76f036c0cf 100644 --- a/library/cpp/actors/util/unordered_cache.h +++ b/library/cpp/actors/util/unordered_cache.h @@ -5,7 +5,7 @@ template <typename T, ui32 Size = 512, ui32 ConcurrencyFactor = 1, typename TChunk = TQueueChunk<T, Size>> class TUnorderedCache : TNonCopyable { - static_assert(std::is_integral<T>::value || std::is_pointer<T>::value, "expect std::is_integral<T>::value || std::is_pointer<T>::value"); + static_assert(std::is_integral<T>::value || std::is_pointer<T>::value, "expect std::is_integral<T>::value || std::is_pointer<T>::value"); public: static constexpr ui32 Concurrency = ConcurrencyFactor * 4; |