diff options
author | Mikhail Borisov <borisov.mikhail@gmail.com> | 2022-02-10 16:45:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:39 +0300 |
commit | a6a92afe03e02795227d2641b49819b687f088f8 (patch) | |
tree | f6984a1d27d5a7ec88a6fdd6e20cd5b7693b6ece /util/memory | |
parent | c6dc8b8bd530985bc4cce0137e9a5de32f1087cb (diff) | |
download | ydb-a6a92afe03e02795227d2641b49819b687f088f8.tar.gz |
Restoring authorship annotation for Mikhail Borisov <borisov.mikhail@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'util/memory')
-rw-r--r-- | util/memory/benchmark/pool/metrics/main.py | 2 | ||||
-rw-r--r-- | util/memory/tempbuf.cpp | 24 |
2 files changed, 13 insertions, 13 deletions
diff --git a/util/memory/benchmark/pool/metrics/main.py b/util/memory/benchmark/pool/metrics/main.py index cc17b7b888..1674fb3aa4 100644 --- a/util/memory/benchmark/pool/metrics/main.py +++ b/util/memory/benchmark/pool/metrics/main.py @@ -2,4 +2,4 @@ import yatest.common as yc def test_export_metrics(metrics): - metrics.set_benchmark(yc.execute_benchmark('util/memory/benchmark/pool/pool', threads=8)) + metrics.set_benchmark(yc.execute_benchmark('util/memory/benchmark/pool/pool', threads=8)) diff --git a/util/memory/tempbuf.cpp b/util/memory/tempbuf.cpp index 09a2d0f140..06a43843ba 100644 --- a/util/memory/tempbuf.cpp +++ b/util/memory/tempbuf.cpp @@ -132,7 +132,7 @@ namespace { Unused_.ForEach(deleter); } - inline TPerThreadedBuf* Acquire() { + inline TPerThreadedBuf* Acquire() { if (!Unused_.Empty()) { return Unused_.PopFront(); } @@ -154,15 +154,15 @@ static inline TTempBufManager* TempBufManager() { return FastTlsSingletonWithPriority<TTempBufManager, 2>(); } -static inline TTempBuf::TImpl* AcquireSmallBuffer(size_t size) { -#if defined(_asan_enabled_) - return new (size) TAllocedBuf(); -#else - Y_UNUSED(size); - return TempBufManager()->Acquire(); -#endif -} - +static inline TTempBuf::TImpl* AcquireSmallBuffer(size_t size) { +#if defined(_asan_enabled_) + return new (size) TAllocedBuf(); +#else + Y_UNUSED(size); + return TempBufManager()->Acquire(); +#endif +} + void TPerThreadedBuf::Dispose() noexcept { if (Manager_ == TempBufManager()) { Manager_->Return(this); @@ -172,7 +172,7 @@ void TPerThreadedBuf::Dispose() noexcept { } TTempBuf::TTempBuf() - : Impl_(AcquireSmallBuffer(TMP_BUF_LEN)) + : Impl_(AcquireSmallBuffer(TMP_BUF_LEN)) { } @@ -183,7 +183,7 @@ TTempBuf::TTempBuf() */ static inline TTempBuf::TImpl* ConstructImpl(size_t len) { if (len <= TMP_BUF_LEN) { - return AcquireSmallBuffer(len); + return AcquireSmallBuffer(len); } return new (len) TAllocedBuf(); |