diff options
author | Ruslan Kovalev <ruslan.a.kovalev@gmail.com> | 2022-02-10 16:46:45 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:45 +0300 |
commit | 9123176b341b6f2658cff5132482b8237c1416c8 (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /util/memory/pool_ut.cpp | |
parent | 59e19371de37995fcb36beb16cd6ec030af960bc (diff) | |
download | ydb-9123176b341b6f2658cff5132482b8237c1416c8.tar.gz |
Restoring authorship annotation for Ruslan Kovalev <ruslan.a.kovalev@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'util/memory/pool_ut.cpp')
-rw-r--r-- | util/memory/pool_ut.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/util/memory/pool_ut.cpp b/util/memory/pool_ut.cpp index dc5893778a..1158a8ca42 100644 --- a/util/memory/pool_ut.cpp +++ b/util/memory/pool_ut.cpp @@ -99,33 +99,33 @@ private: } alloc.CheckAtEnd(); - + { TMemoryPool pool(150, TMemoryPool::TExpGrow::Instance(), &alloc); - + pool.Allocate(8); - + size_t memavail = pool.Available(); size_t memwaste = pool.MemoryWaste(); size_t memalloc = pool.MemoryAllocated(); - + for (size_t i = 0; i < 1000; ++i) { void* m = pool.Allocate(i); UNIT_ASSERT(m); memset(m, 0, i); } - + pool.ClearKeepFirstChunk(); - + UNIT_ASSERT_VALUES_EQUAL(memalloc - 8, pool.MemoryAllocated()); UNIT_ASSERT_VALUES_EQUAL(memwaste + 8, pool.MemoryWaste()); UNIT_ASSERT_VALUES_EQUAL(memavail + 8, pool.Available()); - + for (size_t i = 0; i < 1000; ++i) { void* m = pool.Allocate(i); UNIT_ASSERT(m); memset(m, 0, i); - } + } pool.Clear(); @@ -133,7 +133,7 @@ private: UNIT_ASSERT_VALUES_EQUAL(0, pool.MemoryWaste()); UNIT_ASSERT_VALUES_EQUAL(0, pool.Available()); } - + alloc.CheckAtEnd(); struct TConstructorTest { |