diff options
author | asa <asa@yandex-team.ru> | 2022-02-10 16:50:54 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:54 +0300 |
commit | 74f28e6c6fad7c4b75d97dcc239d29df04e525cb (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 | |
parent | c3206fd73f199b90b23e450b1d30b63c8e13a5a6 (diff) | |
download | ydb-74f28e6c6fad7c4b75d97dcc239d29df04e525cb.tar.gz |
Restoring authorship annotation for <asa@yandex-team.ru>. Commit 2 of 2.
-rw-r--r-- | library/cpp/getopt/small/opt.cpp | 6 | ||||
-rw-r--r-- | util/generic/noncopyable.h | 14 | ||||
-rw-r--r-- | util/system/condvar.h | 2 | ||||
-rw-r--r-- | util/system/filemap.cpp | 6 | ||||
-rw-r--r-- | util/system/filemap.h | 4 | ||||
-rw-r--r-- | util/system/thread.cpp | 2 | ||||
-rw-r--r-- | util/system/tls.cpp | 6 | ||||
-rw-r--r-- | util/system/tls.h | 34 |
8 files changed, 37 insertions, 37 deletions
diff --git a/library/cpp/getopt/small/opt.cpp b/library/cpp/getopt/small/opt.cpp index 2c90306e16..744501765c 100644 --- a/library/cpp/getopt/small/opt.cpp +++ b/library/cpp/getopt/small/opt.cpp @@ -53,14 +53,14 @@ Opt::Opt(int argc, const char* argv[], const char* optString, const Ion* longOpt int Opt::Get() { return Get(nullptr); -} - +} + int Opt::Get(int* longOptionIndex) { if (GotError_) return EOF; Arg = nullptr; - + try { bool r = OptsParser_->Next(); Ind = (int)OptsParser_->Pos_; diff --git a/util/generic/noncopyable.h b/util/generic/noncopyable.h index 8bf6a36c85..c007934133 100644 --- a/util/generic/noncopyable.h +++ b/util/generic/noncopyable.h @@ -1,8 +1,8 @@ #pragma once - + /** * @class TNonCopyable - * + * * Inherit your class from `TNonCopyable` if you want to make it noncopyable. * * Example usage: @@ -11,8 +11,8 @@ * // ... * }; * @endcode - */ - + */ + namespace NNonCopyable { // protection from unintended ADL struct TNonCopyable { TNonCopyable(const TNonCopyable&) = delete; @@ -20,7 +20,7 @@ namespace NNonCopyable { // protection from unintended ADL TNonCopyable() = default; ~TNonCopyable() = default; - }; + }; struct TMoveOnly { TMoveOnly(TMoveOnly&&) noexcept = default; @@ -32,7 +32,7 @@ namespace NNonCopyable { // protection from unintended ADL TMoveOnly() = default; ~TMoveOnly() = default; }; -} - +} + using TNonCopyable = NNonCopyable::TNonCopyable; using TMoveOnly = NNonCopyable::TMoveOnly; diff --git a/util/system/condvar.h b/util/system/condvar.h index ed419ba65e..569162717c 100644 --- a/util/system/condvar.h +++ b/util/system/condvar.h @@ -5,7 +5,7 @@ #include <util/generic/ptr.h> #include <util/generic/noncopyable.h> #include <util/datetime/base.h> - + #include <utility> class TCondVar { diff --git a/util/system/filemap.cpp b/util/system/filemap.cpp index a05a980214..7454a4cb94 100644 --- a/util/system/filemap.cpp +++ b/util/system/filemap.cpp @@ -507,13 +507,13 @@ TFileMap::TMapResult TFileMap::ResizeAndRemap(i64 offset, size_t size) { void TFileMap::Unmap() { if (!Region_.IsMapped()) { return; - } + } if (Map_.Unmap(Region_)) { Region_.Reset(); } else { ythrow yexception() << "can't unmap file"; - } + } } TFileMap::~TFileMap() { @@ -522,7 +522,7 @@ TFileMap::~TFileMap() { Unmap(); } catch (...) { // ¯\_(ツ)_/¯ - } + } } void TFileMap::Precharge(size_t pos, size_t size) const { diff --git a/util/system/filemap.h b/util/system/filemap.h index dc2840e779..11be64bff4 100644 --- a/util/system/filemap.h +++ b/util/system/filemap.h @@ -67,7 +67,7 @@ struct TMemoryMapCommon { static TString UnknownFileName(); }; Y_DECLARE_OPERATORS_FOR_FLAGS(TMemoryMapCommon::EOpenMode) - + class TMemoryMap: public TMemoryMapCommon { public: explicit TMemoryMap(const TString& name); @@ -161,7 +161,7 @@ public: inline size_t MappedSize() const noexcept { return Region_.MappedSize(); } - + TFile GetFile() const noexcept { return Map_.GetFile(); } diff --git a/util/system/thread.cpp b/util/system/thread.cpp index 61fc11237c..6236746c2d 100644 --- a/util/system/thread.cpp +++ b/util/system/thread.cpp @@ -105,7 +105,7 @@ namespace { inline void Detach() { ::CloseHandle(Handle); } - + static ui32 __stdcall Proxy(void* ptr) { NTls::TCleaner cleaner; diff --git a/util/system/tls.cpp b/util/system/tls.cpp index 99c11900fc..c2f1a04a14 100644 --- a/util/system/tls.cpp +++ b/util/system/tls.cpp @@ -11,9 +11,9 @@ #if defined(_unix_) #include <pthread.h> #endif - + using namespace NTls; - + namespace { static inline TAtomicBase AcquireKey() { static TAtomic cur; @@ -59,7 +59,7 @@ namespace { inline void* Get() const noexcept { return Data_; } - + private: void* Data_; TDtor Dtor_; diff --git a/util/system/tls.h b/util/system/tls.h index a1e7f03fde..3c4f56dbeb 100644 --- a/util/system/tls.h +++ b/util/system/tls.h @@ -125,7 +125,7 @@ #define Y_THREAD(T) ::NTls::TValue<T> #define Y_STATIC_THREAD(T) static Y_THREAD(T) -// gcc and msvc support automatic tls for POD types +// gcc and msvc support automatic tls for POD types #if defined(Y_DISABLE_THRKEY_OPTIMIZATION) // nothing to do #elif defined(__clang__) @@ -139,13 +139,13 @@ #define Y_POD_THREAD(T) __declspec(thread) T #define Y_POD_STATIC_THREAD(T) __declspec(thread) static T #endif - + #if !defined(Y_POD_THREAD) || !defined(Y_POD_STATIC_THREAD) #define Y_POD_THREAD(T) Y_THREAD(T) #define Y_POD_STATIC_THREAD(T) Y_STATIC_THREAD(T) #else #define Y_HAVE_FAST_POD_TLS -#endif +#endif namespace NPrivate { void FillWithTrash(void* ptr, size_t len); @@ -162,10 +162,10 @@ namespace NTls { void* Get() const; void Set(void* ptr) const; - + static void Cleanup() noexcept; - - private: + + private: class TImpl; THolder<TImpl> Impl_; }; @@ -174,8 +174,8 @@ namespace NTls { inline ~TCleaner() { TKey::Cleanup(); } - }; - + }; + template <class T> class TValue: public TMoveOnly { class TConstructor { @@ -215,7 +215,7 @@ namespace NTls { T1 Value; }; - public: + public: inline TValue() : Constructor_(new TDefaultConstructor()) , Key_(Dtor) @@ -231,7 +231,7 @@ namespace NTls { template <class T1> inline T& operator=(const T1& val) { - return Get() = val; + return Get() = val; } inline operator const T&() const { @@ -243,8 +243,8 @@ namespace NTls { } inline const T& operator->() const { - return Get(); - } + return Get(); + } inline T& operator->() { return Get(); @@ -265,31 +265,31 @@ namespace NTls { inline T* GetPtr() const { T* val = static_cast<T*>(Key_.Get()); - if (!val) { + if (!val) { THolder<void> mem(::operator new(sizeof(T))); THolder<T> newval(Constructor_->Construct(mem.Get())); Y_UNUSED(mem.Release()); Key_.Set((void*)newval.Get()); val = newval.Release(); - } + } return val; } private: - static void Dtor(void* ptr) { + static void Dtor(void* ptr) { THolder<void> mem(ptr); ((T*)ptr)->~T(); ::NPrivate::FillWithTrash(ptr, sizeof(T)); } - private: + private: THolder<TConstructor> Constructor_; TKey Key_; }; -} +} template <class T> static inline T& TlsRef(NTls::TValue<T>& v) noexcept { |