diff options
author | vmordovin <vmordovin@yandex-team.ru> | 2022-02-10 16:48:14 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:14 +0300 |
commit | 7c7f9bbcf57e15838d15afa94b31d8254b5d7776 (patch) | |
tree | 17073f853e6b3a1a95708e8aa0ea12fa42a717e7 /util | |
parent | 466f96709329ff77ded50177df94d1893a226c00 (diff) | |
download | ydb-7c7f9bbcf57e15838d15afa94b31d8254b5d7776.tar.gz |
Restoring authorship annotation for <vmordovin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util')
-rw-r--r-- | util/memory/pool.h | 18 | ||||
-rw-r--r-- | util/network/socket.cpp | 8 | ||||
-rw-r--r-- | util/stream/buffered.cpp | 12 | ||||
-rw-r--r-- | util/stream/file.cpp | 2 | ||||
-rw-r--r-- | util/stream/zlib.cpp | 18 | ||||
-rw-r--r-- | util/system/hp_timer.cpp | 2 | ||||
-rw-r--r-- | util/thread/pool.cpp | 2 | ||||
-rw-r--r-- | util/ysaveload.h | 4 |
8 files changed, 33 insertions, 33 deletions
diff --git a/util/memory/pool.h b/util/memory/pool.h index 13c8b6b9ed..dc4a4fdc02 100644 --- a/util/memory/pool.h +++ b/util/memory/pool.h @@ -307,8 +307,8 @@ private: }; template <typename TPool> -struct TPoolableBase { - inline void* operator new(size_t bytes, TPool& pool) { +struct TPoolableBase { + inline void* operator new(size_t bytes, TPool& pool) { return pool.Allocate(bytes); } @@ -326,9 +326,9 @@ private: inline void* operator new(size_t); // disallow default allocation }; -struct TPoolable: public TPoolableBase<TMemoryPool> { -}; - +struct TPoolable: public TPoolableBase<TMemoryPool> { +}; + class TMemoryPoolAllocator: public IAllocator { public: inline TMemoryPoolAllocator(TMemoryPool* pool) @@ -350,8 +350,8 @@ private: TMemoryPool* Pool_; }; -template <class T, class TPool> -class TPoolAllocBase { +template <class T, class TPool> +class TPoolAllocBase { public: using pointer = T*; using const_pointer = const T*; @@ -415,8 +415,8 @@ private: }; template <class T> -using TPoolAlloc = TPoolAllocBase<T, TMemoryPool>; - +using TPoolAlloc = TPoolAllocBase<T, TMemoryPool>; + // Any type since it is supposed to be rebound anyway. using TPoolAllocator = TPoolAlloc<int>; diff --git a/util/network/socket.cpp b/util/network/socket.cpp index 4f6e804346..8e8cbf6b5d 100644 --- a/util/network/socket.cpp +++ b/util/network/socket.cpp @@ -283,7 +283,7 @@ void SetSocketTimeout(SOCKET s, long sec, long msec) { #endif } -void SetLinger(SOCKET s, bool on, unsigned len) { +void SetLinger(SOCKET s, bool on, unsigned len) { #ifdef SO_LINGER struct linger l = {on, (u_short)len}; @@ -1162,10 +1162,10 @@ static inline void SetNonBlockSocket(SOCKET fd, int value) { unsigned long outbuf = 0; DWORD written = 0; - if (!inbuf) { + if (!inbuf) { WSAEventSelect(fd, nullptr, 0); - } - + } + if (WSAIoctl(fd, FIONBIO, &inbuf, sizeof(inbuf), &outbuf, sizeof(outbuf), &written, 0, 0) == SOCKET_ERROR) { ythrow TSystemError() << "can not set non block socket state"; } diff --git a/util/stream/buffered.cpp b/util/stream/buffered.cpp index a00e592e1c..2356522efd 100644 --- a/util/stream/buffered.cpp +++ b/util/stream/buffered.cpp @@ -250,15 +250,15 @@ public: try { Flush(); } catch (...) { - try { + try { DoFinish(); - } catch (...) { + } catch (...) { // ¯\_(ツ)_/¯ - } - + } + throw; - } - + } + DoFinish(); } diff --git a/util/stream/file.cpp b/util/stream/file.cpp index dc5d2f6311..73c709f0f9 100644 --- a/util/stream/file.cpp +++ b/util/stream/file.cpp @@ -67,7 +67,7 @@ void TUnbufferedFileOutput::DoWrite(const void* buf, size_t len) { void TUnbufferedFileOutput::DoFlush() { if (File_.IsOpen()) { File_.Flush(); - } + } } class TMappedFileInput::TImpl: public TBlob { diff --git a/util/stream/zlib.cpp b/util/stream/zlib.cpp index 60f4e9439f..6f6322c123 100644 --- a/util/stream/zlib.cpp +++ b/util/stream/zlib.cpp @@ -356,25 +356,25 @@ TZLibCompress::~TZLibCompress() { } void TZLibCompress::DoWrite(const void* buf, size_t size) { - if (!Impl_) { + if (!Impl_) { ythrow TZLibCompressorError() << "can not write to finished zlib stream"; - } - + } + Impl_->Write(buf, size); } void TZLibCompress::DoFlush() { if (Impl_) { - Impl_->Flush(); - } + Impl_->Flush(); + } } void TZLibCompress::DoFinish() { - THolder<TImpl> impl(Impl_.Release()); - + THolder<TImpl> impl(Impl_.Release()); + if (impl) { - impl->Finish(); - } + impl->Finish(); + } } TBufferedZLibDecompress::~TBufferedZLibDecompress() = default; diff --git a/util/system/hp_timer.cpp b/util/system/hp_timer.cpp index e4c3f21e6b..42fc4d0c29 100644 --- a/util/system/hp_timer.cpp +++ b/util/system/hp_timer.cpp @@ -16,7 +16,7 @@ namespace { } static inline const TFreq& Instance() { - return *SingletonWithPriority<TFreq, 1>(); + return *SingletonWithPriority<TFreq, 1>(); } static double EstimateCPUClock() { diff --git a/util/thread/pool.cpp b/util/thread/pool.cpp index 05fad02e9b..d734c98a5d 100644 --- a/util/thread/pool.cpp +++ b/util/thread/pool.cpp @@ -501,7 +501,7 @@ private: AllDone_ = true; - while (AtomicGet(ThrCount_)) { + while (AtomicGet(ThrCount_)) { Mutex_.Release(); CondReady_.Signal(); Mutex_.Acquire(); diff --git a/util/ysaveload.h b/util/ysaveload.h index 02efb4049b..1ea12687c5 100644 --- a/util/ysaveload.h +++ b/util/ysaveload.h @@ -23,8 +23,8 @@ public: enum { IsSerializablePod = TTypeTraits<T>::IsPod && !std::is_pointer<T>::value }; -}; - +}; + struct TSerializeException: public yexception { }; |