aboutsummaryrefslogtreecommitdiffstats
path: root/util/memory/pool_ut.cpp
diff options
context:
space:
mode:
authorRuslan Kovalev <ruslan.a.kovalev@gmail.com>2022-02-10 16:46:44 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:44 +0300
commit59e19371de37995fcb36beb16cd6ec030af960bc (patch)
treefa68e36093ebff8b805462e9e6d331fe9d348214 /util/memory/pool_ut.cpp
parent89db6fe2fe2c32d2a832ddfeb04e8d078e301084 (diff)
downloadydb-59e19371de37995fcb36beb16cd6ec030af960bc.tar.gz
Restoring authorship annotation for Ruslan Kovalev <ruslan.a.kovalev@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'util/memory/pool_ut.cpp')
-rw-r--r--util/memory/pool_ut.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/util/memory/pool_ut.cpp b/util/memory/pool_ut.cpp
index 1158a8ca42..dc5893778a 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 {