diff options
| author | nga <[email protected]> | 2022-02-10 16:48:09 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:48:09 +0300 |
| commit | 1f553f46fb4f3c5eec631352cdd900a0709016af (patch) | |
| tree | a231fba2c03b440becaea6c86a2702d0bfb0336e /library/cpp/messagebus/actor/temp_tls_vector.h | |
| parent | c4de7efdedc25b49cbea74bd589eecb61b55b60a (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/messagebus/actor/temp_tls_vector.h')
| -rw-r--r-- | library/cpp/messagebus/actor/temp_tls_vector.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/library/cpp/messagebus/actor/temp_tls_vector.h b/library/cpp/messagebus/actor/temp_tls_vector.h index 675d92f5b0b..5c535dd07c4 100644 --- a/library/cpp/messagebus/actor/temp_tls_vector.h +++ b/library/cpp/messagebus/actor/temp_tls_vector.h @@ -1,34 +1,34 @@ -#pragma once - +#pragma once + #include "thread_extra.h" #include <util/generic/vector.h> -#include <util/system/yassert.h> - +#include <util/system/yassert.h> + template <typename T, typename TTag = void, template <typename, class> class TVectorType = TVector> -class TTempTlsVector { -private: - struct TTagForTls {}; - +class TTempTlsVector { +private: + struct TTagForTls {}; + TVectorType<T, std::allocator<T>>* Vector; -public: +public: TVectorType<T, std::allocator<T>>* GetVector() { - return Vector; - } - - TTempTlsVector() { + return Vector; + } + + TTempTlsVector() { Vector = FastTlsSingletonWithTag<TVectorType<T, std::allocator<T>>, TTagForTls>(); Y_ASSERT(Vector->empty()); - } - - ~TTempTlsVector() { + } + + ~TTempTlsVector() { Clear(); } void Clear() { - Vector->clear(); - } + Vector->clear(); + } size_t Capacity() const noexcept { return Vector->capacity(); @@ -37,4 +37,4 @@ public: void Shrink() { Vector->shrink_to_fit(); } -}; +}; |
