diff options
author | Alexander Gololobov <davenger@yandex-team.com> | 2022-02-10 16:47:37 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:37 +0300 |
commit | 39608cdb86363c75ce55b2b9a69841c3b71f22cf (patch) | |
tree | 4ec132c1665bd4d68e3628aa18d937c70d32413b /util/memory/pool.cpp | |
parent | 54295b9bd4dc45c54d804084fd846d945148a7f0 (diff) | |
download | ydb-39608cdb86363c75ce55b2b9a69841c3b71f22cf.tar.gz |
Restoring authorship annotation for Alexander Gololobov <davenger@yandex-team.com>. Commit 1 of 2.
Diffstat (limited to 'util/memory/pool.cpp')
-rw-r--r-- | util/memory/pool.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/util/memory/pool.cpp b/util/memory/pool.cpp index 9a011f0e4f..138e5afc8a 100644 --- a/util/memory/pool.cpp +++ b/util/memory/pool.cpp @@ -17,12 +17,12 @@ void TMemoryPool::AddChunk(size_t hint) { } TBlock nb = Alloc_->Allocate(allocSize); - // Add previous chunk's stats - if (Current_ != &Empty_) { - MemoryAllocatedBeforeCurrent_ += Current_->Used(); - MemoryWasteBeforeCurrent_ += Current_->Left(); - } - + // Add previous chunk's stats + if (Current_ != &Empty_) { + MemoryAllocatedBeforeCurrent_ += Current_->Used(); + MemoryWasteBeforeCurrent_ += Current_->Left(); + } + BlockSize_ = GrowPolicy_->Next(dataLen); Current_ = new (nb.Data) TChunk(nb.Len - sizeof(TChunk)); Chunks_.PushBack(Current_); @@ -38,7 +38,7 @@ void TMemoryPool::DoClear(bool keepfirst) noexcept { Current_ = c; BlockSize_ = c->BlockLength() - sizeof(TChunk); MemoryAllocatedBeforeCurrent_ = 0; - MemoryWasteBeforeCurrent_ = 0; + MemoryWasteBeforeCurrent_ = 0; return; } @@ -50,6 +50,6 @@ void TMemoryPool::DoClear(bool keepfirst) noexcept { Current_ = &Empty_; BlockSize_ = Origin_; - MemoryAllocatedBeforeCurrent_ = 0; - MemoryWasteBeforeCurrent_ = 0; + MemoryAllocatedBeforeCurrent_ = 0; + MemoryWasteBeforeCurrent_ = 0; } |