diff options
| author | Dan Engelbrecht <[email protected]> | 2022-05-02 16:50:08 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-05-02 16:50:08 +0200 |
| commit | 0599d52d80beb85e50ffe1f56c8434376a8c08a2 (patch) | |
| tree | 9c27adbe6bbbcd79d0153c6167cd385f0ded98e3 | |
| parent | Refactor WriteChunk to not need callback (diff) | |
| download | zen-0599d52d80beb85e50ffe1f56c8434376a8c08a2.tar.xz zen-0599d52d80beb85e50ffe1f56c8434376a8c08a2.zip | |
simplify lambda captures
| -rw-r--r-- | zenserver/cache/structuredcachestore.cpp | 46 | ||||
| -rw-r--r-- | zenserver/projectstore.cpp | 2 | ||||
| -rw-r--r-- | zenstore/blockstore.cpp | 22 | ||||
| -rw-r--r-- | zenstore/compactcas.cpp | 20 | ||||
| -rw-r--r-- | zenstore/filecas.cpp | 4 | ||||
| -rw-r--r-- | zenstore/gc.cpp | 14 |
6 files changed, 41 insertions, 67 deletions
diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp index 6f6f182b9..46f9d8fe6 100644 --- a/zenserver/cache/structuredcachestore.cpp +++ b/zenserver/cache/structuredcachestore.cpp @@ -366,8 +366,8 @@ void ZenCacheStore::GatherReferences(GcContext& GcCtx) { Stopwatch Timer; - const auto Guard = MakeGuard( - [this, &Timer] { ZEN_INFO("cache gathered all references from '{}' in {}", m_RootDir, NiceTimeSpanMs(Timer.GetElapsedTimeMs())); }); + const auto Guard = + MakeGuard([&] { ZEN_INFO("cache gathered all references from '{}' in {}", m_RootDir, NiceTimeSpanMs(Timer.GetElapsedTimeMs())); }); access_tracking::AccessTimes AccessTimes; m_MemLayer.GatherAccessTimes(AccessTimes); @@ -650,7 +650,7 @@ ZenCacheDiskLayer::CacheBucket::MakeIndexSnapshot() ZEN_INFO("write store snapshot for '{}'", m_BucketDir / m_BucketName); uint64_t EntryCount = 0; Stopwatch Timer; - const auto _ = MakeGuard([this, &EntryCount, &Timer] { + const auto _ = MakeGuard([&] { ZEN_INFO("wrote store snapshot for '{}' containing #{} entries in {}", m_BucketDir / m_BucketName, EntryCount, @@ -734,7 +734,7 @@ ZenCacheDiskLayer::CacheBucket::ReadIndexFile() if (std::filesystem::is_regular_file(IndexPath)) { Stopwatch Timer; - const auto _ = MakeGuard([this, &Entries, &Timer] { + const auto _ = MakeGuard([&] { ZEN_INFO("read store '{}' index containing #{} entries in {}", m_BucketDir / m_BucketName, Entries.size(), @@ -787,7 +787,7 @@ ZenCacheDiskLayer::CacheBucket::ReadLog(uint64_t SkipEntryCount) if (std::filesystem::is_regular_file(LogPath)) { Stopwatch Timer; - const auto _ = MakeGuard([LogPath, &Entries, &Timer] { + const auto _ = MakeGuard([&] { ZEN_INFO("read store '{}' log containing #{} entries in {}", LogPath, Entries.size(), NiceTimeSpanMs(Timer.GetElapsedTimeMs())); }); TCasLogFile<DiskIndexEntry> CasLog; @@ -847,7 +847,7 @@ ZenCacheDiskLayer::CacheBucket::MigrateLegacyData(bool CleanSource) uint32_t MigratedBlockCount = 0; Stopwatch MigrationTimer; uint64_t TotalSize = 0; - const auto _ = MakeGuard([this, &MigrationTimer, &MigratedChunkCount, &MigratedBlockCount, &TotalSize] { + const auto _ = MakeGuard([&] { ZEN_INFO("migrated store '{}' to #{} chunks in #{} blocks in {} ({})", m_BucketDir / m_BucketName, MigratedChunkCount, @@ -871,7 +871,7 @@ ZenCacheDiskLayer::CacheBucket::MigrateLegacyData(bool CleanSource) LegacyCasLog.Open(LegacyLogPath, CleanSource ? CasLogFile::Mode::kWrite : CasLogFile::Mode::kRead); { Stopwatch Timer; - const auto __ = MakeGuard([LegacyLogPath, &LegacyDiskIndex, &Timer] { + const auto __ = MakeGuard([&] { ZEN_INFO("read store '{}' legacy log containing #{} entries in {}", LegacyLogPath, LegacyDiskIndex.size(), @@ -1317,7 +1317,7 @@ ZenCacheDiskLayer::CacheBucket::GatherReferences(GcContext& GcCtx) uint64_t ReadBlockLongestTimeUs = 0; Stopwatch TotalTimer; - const auto _ = MakeGuard([this, &TotalTimer, &WriteBlockTimeUs, &WriteBlockLongestTimeUs, &ReadBlockTimeUs, &ReadBlockLongestTimeUs] { + const auto _ = MakeGuard([&] { ZEN_INFO("gathered references from '{}' in {} write lock: {} ({}), read lock: {} ({})", m_BucketDir / m_BucketName, NiceTimeSpanMs(TotalTimer.GetElapsedTimeMs()), @@ -1336,7 +1336,7 @@ ZenCacheDiskLayer::CacheBucket::GatherReferences(GcContext& GcCtx) { RwLock::SharedLockScope __(m_IndexLock); Stopwatch Timer; - const auto ___ = MakeGuard([&Timer, &WriteBlockTimeUs, &WriteBlockLongestTimeUs] { + const auto ___ = MakeGuard([&] { uint64_t ElapsedUs = Timer.GetElapsedTimeUs(); WriteBlockTimeUs += ElapsedUs; WriteBlockLongestTimeUs = std::max(ElapsedUs, WriteBlockLongestTimeUs); @@ -1373,7 +1373,7 @@ ZenCacheDiskLayer::CacheBucket::GatherReferences(GcContext& GcCtx) { RwLock::SharedLockScope __(m_IndexLock); Stopwatch Timer; - const auto ___ = MakeGuard([&Timer, &WriteBlockTimeUs, &WriteBlockLongestTimeUs] { + const auto ___ = MakeGuard([&] { uint64_t ElapsedUs = Timer.GetElapsedTimeUs(); WriteBlockTimeUs += ElapsedUs; WriteBlockLongestTimeUs = std::max(ElapsedUs, WriteBlockLongestTimeUs); @@ -1421,17 +1421,7 @@ ZenCacheDiskLayer::CacheBucket::CollectGarbage(GcContext& GcCtx) uint64_t DeletedCount = 0; uint64_t MovedCount = 0; - const auto _ = MakeGuard([this, - &TotalTimer, - &WriteBlockTimeUs, - &WriteBlockLongestTimeUs, - &ReadBlockTimeUs, - &ReadBlockLongestTimeUs, - &TotalChunkCount, - &DeletedCount, - &MovedCount, - &DeletedSize, - &OldTotalSize] { + const auto _ = MakeGuard([&] { ZEN_INFO( "garbage collect from '{}' DONE after {}, write lock: {} ({}), read lock: {} ({}), collected {} bytes, deleted #{} and moved " "#{} " @@ -1476,7 +1466,7 @@ ZenCacheDiskLayer::CacheBucket::CollectGarbage(GcContext& GcCtx) { RwLock::SharedLockScope __(m_IndexLock); Stopwatch Timer; - const auto ____ = MakeGuard([&Timer, &WriteBlockTimeUs, &WriteBlockLongestTimeUs] { + const auto ____ = MakeGuard([&] { uint64_t ElapsedUs = Timer.GetElapsedTimeUs(); WriteBlockTimeUs += ElapsedUs; WriteBlockLongestTimeUs = std::max(ElapsedUs, WriteBlockLongestTimeUs); @@ -1530,7 +1520,7 @@ ZenCacheDiskLayer::CacheBucket::CollectGarbage(GcContext& GcCtx) { RwLock::SharedLockScope __(m_IndexLock); Stopwatch Timer; - const auto ____ = MakeGuard([&Timer, &WriteBlockTimeUs, &WriteBlockLongestTimeUs] { + const auto ____ = MakeGuard([&] { uint64_t ElapsedUs = Timer.GetElapsedTimeUs(); WriteBlockTimeUs += ElapsedUs; WriteBlockLongestTimeUs = std::max(ElapsedUs, WriteBlockLongestTimeUs); @@ -1554,7 +1544,7 @@ ZenCacheDiskLayer::CacheBucket::CollectGarbage(GcContext& GcCtx) RwLock::ExclusiveLockScope __(m_IndexLock); Stopwatch Timer; - const auto ___ = MakeGuard([&Timer, &ReadBlockTimeUs, &ReadBlockLongestTimeUs] { + const auto ___ = MakeGuard([&] { uint64_t ElapsedUs = Timer.GetElapsedTimeUs(); ReadBlockTimeUs += ElapsedUs; ReadBlockLongestTimeUs = std::max(ElapsedUs, ReadBlockLongestTimeUs); @@ -1638,9 +1628,7 @@ ZenCacheDiskLayer::CacheBucket::CollectGarbage(GcContext& GcCtx) KeepChunkIndexes, m_PayloadAlignment, false, - [this, &DeletedChunks, &ChunkIndexToChunkHash, &Index, &ReadBlockTimeUs, &ReadBlockLongestTimeUs]( - const BlockStore::MovedChunksArray& MovedChunks, - const BlockStore::ChunkIndexArray& RemovedChunks) { + [&](const BlockStore::MovedChunksArray& MovedChunks, const BlockStore::ChunkIndexArray& RemovedChunks) { std::vector<DiskIndexEntry> LogEntries; LogEntries.reserve(MovedChunks.size() + RemovedChunks.size()); for (const auto& Entry : MovedChunks) @@ -1668,7 +1656,7 @@ ZenCacheDiskLayer::CacheBucket::CollectGarbage(GcContext& GcCtx) { RwLock::ExclusiveLockScope __(m_IndexLock); Stopwatch Timer; - const auto ____ = MakeGuard([&Timer, &ReadBlockTimeUs, &ReadBlockLongestTimeUs] { + const auto ____ = MakeGuard([&] { uint64_t ElapsedUs = Timer.GetElapsedTimeUs(); ReadBlockTimeUs += ElapsedUs; ReadBlockLongestTimeUs = std::max(ElapsedUs, ReadBlockLongestTimeUs); @@ -1686,7 +1674,7 @@ ZenCacheDiskLayer::CacheBucket::CollectGarbage(GcContext& GcCtx) } } }, - [&GcCtx]() { return GcCtx.CollectSmallObjects(); }); + [&]() { return GcCtx.CollectSmallObjects(); }); GcCtx.DeletedCas(DeletedChunks); } diff --git a/zenserver/projectstore.cpp b/zenserver/projectstore.cpp index 617f50660..aceb2df00 100644 --- a/zenserver/projectstore.cpp +++ b/zenserver/projectstore.cpp @@ -976,7 +976,7 @@ ProjectStore::GatherReferences(GcContext& GcCtx) { Stopwatch Timer; const auto Guard = - MakeGuard([this, &Timer] { ZEN_INFO("project store gathered all references in {}", NiceTimeSpanMs(Timer.GetElapsedTimeMs())); }); + MakeGuard([&] { ZEN_INFO("project store gathered all references in {}", NiceTimeSpanMs(Timer.GetElapsedTimeMs())); }); DiscoverProjects(); diff --git a/zenstore/blockstore.cpp b/zenstore/blockstore.cpp index 178687b5f..e502113fc 100644 --- a/zenstore/blockstore.cpp +++ b/zenstore/blockstore.cpp @@ -292,17 +292,7 @@ BlockStore::ReclaimSpace(const ReclaimSnapshotState& Snapshot, uint64_t DeletedCount = 0; Stopwatch TotalTimer; - const auto _ = MakeGuard([this, - &TotalTimer, - &WriteBlockTimeUs, - &WriteBlockLongestTimeUs, - &ReadBlockTimeUs, - &ReadBlockLongestTimeUs, - &TotalChunkCount, - &DeletedCount, - &MovedCount, - &DeletedSize, - OldTotalSize] { + const auto _ = MakeGuard([&] { ZEN_INFO( "reclaim space for '{}' DONE after {}, write lock: {} ({}), read lock: {} ({}), collected {} bytes, deleted #{} and moved " "#{} " @@ -414,7 +404,7 @@ BlockStore::ReclaimSpace(const ReclaimSnapshotState& Snapshot, { RwLock::SharedLockScope _i(m_InsertLock); Stopwatch Timer; - const auto __ = MakeGuard([&Timer, &WriteBlockTimeUs, &WriteBlockLongestTimeUs] { + const auto __ = MakeGuard([&] { uint64_t ElapsedUs = Timer.GetElapsedTimeUs(); WriteBlockTimeUs += ElapsedUs; WriteBlockLongestTimeUs = std::max(ElapsedUs, WriteBlockLongestTimeUs); @@ -436,7 +426,7 @@ BlockStore::ReclaimSpace(const ReclaimSnapshotState& Snapshot, { RwLock::ExclusiveLockScope _i(m_InsertLock); Stopwatch Timer; - const auto __ = MakeGuard([&Timer, &ReadBlockTimeUs, &ReadBlockLongestTimeUs] { + const auto __ = MakeGuard([&] { uint64_t ElapsedUs = Timer.GetElapsedTimeUs(); ReadBlockTimeUs += ElapsedUs; ReadBlockLongestTimeUs = std::max(ElapsedUs, ReadBlockLongestTimeUs); @@ -476,7 +466,7 @@ BlockStore::ReclaimSpace(const ReclaimSnapshotState& Snapshot, MovedChunks.clear(); RwLock::ExclusiveLockScope __(m_InsertLock); Stopwatch Timer; - const auto ___ = MakeGuard([&Timer, &ReadBlockTimeUs, &ReadBlockLongestTimeUs] { + const auto ___ = MakeGuard([&] { uint64_t ElapsedUs = Timer.GetElapsedTimeUs(); ReadBlockTimeUs += ElapsedUs; ReadBlockLongestTimeUs = std::max(ElapsedUs, ReadBlockLongestTimeUs); @@ -515,7 +505,7 @@ BlockStore::ReclaimSpace(const ReclaimSnapshotState& Snapshot, NiceBytes(Space.Free + ReclaimedSpace)); RwLock::ExclusiveLockScope _l(m_InsertLock); Stopwatch Timer; - const auto __ = MakeGuard([&Timer, &ReadBlockTimeUs, &ReadBlockLongestTimeUs] { + const auto __ = MakeGuard([&] { uint64_t ElapsedUs = Timer.GetElapsedTimeUs(); ReadBlockTimeUs += ElapsedUs; ReadBlockLongestTimeUs = std::max(ElapsedUs, ReadBlockLongestTimeUs); @@ -559,7 +549,7 @@ BlockStore::ReclaimSpace(const ReclaimSnapshotState& Snapshot, { RwLock::ExclusiveLockScope __(m_InsertLock); Stopwatch Timer; - const auto ___ = MakeGuard([&Timer, &ReadBlockTimeUs, &ReadBlockLongestTimeUs] { + const auto ___ = MakeGuard([&] { uint64_t ElapsedUs = Timer.GetElapsedTimeUs(); ReadBlockTimeUs += ElapsedUs; ReadBlockLongestTimeUs = std::max(ElapsedUs, ReadBlockLongestTimeUs); diff --git a/zenstore/compactcas.cpp b/zenstore/compactcas.cpp index c6115024b..e0f84e044 100644 --- a/zenstore/compactcas.cpp +++ b/zenstore/compactcas.cpp @@ -344,7 +344,7 @@ CasContainerStrategy::Scrub(ScrubContext& Ctx) m_BlockStore.IterateChunks( ChunkLocations, - [&ChunkIndexToChunkHash, &BadKeys](size_t ChunkIndex, const void* Data, uint64_t Size) { + [&](size_t ChunkIndex, const void* Data, uint64_t Size) { const IoHash ComputedHash = IoHash::HashBuffer(Data, Size); const IoHash& ExpectedHash = ChunkIndexToChunkHash[ChunkIndex]; if (ComputedHash != ExpectedHash) @@ -353,7 +353,7 @@ CasContainerStrategy::Scrub(ScrubContext& Ctx) BadKeys.push_back(ExpectedHash); } }, - [&ChunkIndexToChunkHash, &BadKeys](size_t ChunkIndex, BasicFile& BlockFile, uint64_t Offset, uint64_t Size) { + [&](size_t ChunkIndex, BasicFile& BlockFile, uint64_t Offset, uint64_t Size) { IoHashStream Hasher; BlockFile.StreamByteRange(Offset, Size, [&](const void* Data, uint64_t Size) { Hasher.Append(Data, Size); }); IoHash ComputedHash = Hasher.GetHash(); @@ -493,9 +493,7 @@ CasContainerStrategy::CollectGarbage(GcContext& GcCtx) KeepChunkIndexes, m_PayloadAlignment, false, - [this, &DeletedChunks, &ChunkIndexToChunkHash, &LocationMap, &ReadBlockTimeUs, &ReadBlockLongestTimeUs]( - const BlockStore::MovedChunksArray& MovedChunks, - const BlockStore::ChunkIndexArray& RemovedChunks) { + [&](const BlockStore::MovedChunksArray& MovedChunks, const BlockStore::ChunkIndexArray& RemovedChunks) { std::vector<CasDiskIndexEntry> LogEntries; LogEntries.reserve(MovedChunks.size() + RemovedChunks.size()); for (const auto& Entry : MovedChunks) @@ -518,7 +516,7 @@ CasContainerStrategy::CollectGarbage(GcContext& GcCtx) { RwLock::ExclusiveLockScope __(m_LocationMapLock); Stopwatch Timer; - const auto ____ = MakeGuard([&Timer, &ReadBlockTimeUs, &ReadBlockLongestTimeUs] { + const auto ____ = MakeGuard([&] { uint64_t ElapsedUs = Timer.GetElapsedTimeUs(); ReadBlockTimeUs += ElapsedUs; ReadBlockLongestTimeUs = std::max(ElapsedUs, ReadBlockLongestTimeUs); @@ -547,7 +545,7 @@ CasContainerStrategy::MakeIndexSnapshot() ZEN_INFO("write store snapshot for '{}'", m_Config.RootDirectory / m_ContainerBaseName); uint64_t EntryCount = 0; Stopwatch Timer; - const auto _ = MakeGuard([this, &EntryCount, &Timer] { + const auto _ = MakeGuard([&] { ZEN_INFO("wrote store snapshot for '{}' containing #{} entries in {}", m_Config.RootDirectory / m_ContainerBaseName, EntryCount, @@ -632,7 +630,7 @@ CasContainerStrategy::ReadIndexFile() if (std::filesystem::is_regular_file(IndexPath)) { Stopwatch Timer; - const auto _ = MakeGuard([this, &Entries, &Timer] { + const auto _ = MakeGuard([&] { ZEN_INFO("read store '{}' index containing #{} entries in {}", m_Config.RootDirectory / m_ContainerBaseName, Entries.size(), @@ -685,7 +683,7 @@ CasContainerStrategy::ReadLog(uint64_t SkipEntryCount) if (std::filesystem::is_regular_file(LogPath)) { Stopwatch Timer; - const auto _ = MakeGuard([this, &Entries, &Timer] { + const auto _ = MakeGuard([&] { ZEN_INFO("read store '{}' log containing #{} entries in {}", m_Config.RootDirectory / m_ContainerBaseName, Entries.size(), @@ -745,7 +743,7 @@ CasContainerStrategy::MigrateLegacyData(bool CleanSource) uint32_t MigratedBlockCount = 0; Stopwatch MigrationTimer; uint64_t TotalSize = 0; - const auto _ = MakeGuard([this, &MigrationTimer, &MigratedChunkCount, &MigratedBlockCount, &TotalSize] { + const auto _ = MakeGuard([&] { ZEN_INFO("migrated store '{}' to #{} chunks in #{} blocks in {} ({})", m_Config.RootDirectory / m_ContainerBaseName, MigratedChunkCount, @@ -768,7 +766,7 @@ CasContainerStrategy::MigrateLegacyData(bool CleanSource) LegacyCasLog.Open(LegacyLogPath, CleanSource ? CasLogFile::Mode::kWrite : CasLogFile::Mode::kRead); { Stopwatch Timer; - const auto __ = MakeGuard([this, &LegacyDiskIndex, &Timer] { + const auto __ = MakeGuard([&] { ZEN_INFO("read store '{}' legacy log containing #{} entries in {}", m_Config.RootDirectory / m_ContainerBaseName, LegacyDiskIndex.size(), diff --git a/zenstore/filecas.cpp b/zenstore/filecas.cpp index b53cfaa54..d074a906f 100644 --- a/zenstore/filecas.cpp +++ b/zenstore/filecas.cpp @@ -92,7 +92,7 @@ FileCasStrategy::Initialize(bool IsNewStore) m_CasLog.Open(m_Config.RootDirectory / "cas.ulog", IsNewStore ? CasLogFile::Mode::kTruncate : CasLogFile::Mode::kWrite); Stopwatch Timer; - const auto _ = MakeGuard([this, &Timer] { + const auto _ = MakeGuard([&] { ZEN_INFO("read log {} containing {}", m_Config.RootDirectory / "cas.ulog", NiceBytes(m_TotalSize.load(std::memory_order::relaxed))); }); @@ -692,7 +692,7 @@ FileCasStrategy::CollectGarbage(GcContext& GcCtx) uint64_t OldTotalSize = m_TotalSize.load(std::memory_order::relaxed); Stopwatch TotalTimer; - const auto _ = MakeGuard([this, &TotalTimer, &DeletedCount, &ChunkCount, OldTotalSize] { + const auto _ = MakeGuard([&] { ZEN_INFO("garbage collect for '{}' DONE after {}, deleted {} out of {} files, removed {} out of {}", m_Config.RootDirectory, NiceTimeSpanMs(TotalTimer.GetElapsedTimeMs()), diff --git a/zenstore/gc.cpp b/zenstore/gc.cpp index 21522e46a..4b50668d9 100644 --- a/zenstore/gc.cpp +++ b/zenstore/gc.cpp @@ -76,7 +76,7 @@ namespace { return MakeErrorCodeFromLastError(); } bool Keep = true; - auto _ = MakeGuard([FileHandle, &Keep, Path]() { + auto _ = MakeGuard([&]() { ::CloseHandle(FileHandle); if (!Keep) { @@ -105,7 +105,7 @@ namespace { } bool Keep = true; - auto _ = MakeGuard([Fd, &Keep, Path]() { + auto _ = MakeGuard([&]() { close(Fd); if (!Keep) { @@ -392,7 +392,7 @@ CasGc::CollectGarbage(GcContext& GcCtx) // First gather reference set { Stopwatch Timer; - const auto Guard = MakeGuard([this, &Timer] { ZEN_INFO("gathered references in {}", NiceTimeSpanMs(Timer.GetElapsedTimeMs())); }); + const auto Guard = MakeGuard([&] { ZEN_INFO("gathered references in {}", NiceTimeSpanMs(Timer.GetElapsedTimeMs())); }); for (GcContributor* Contributor : m_GcContribs) { Contributor->GatherReferences(GcCtx); @@ -433,7 +433,7 @@ CasGc::CollectGarbage(GcContext& GcCtx) { Stopwatch Timer; - const auto Guard = MakeGuard([this, &Timer] { ZEN_INFO("collected garbage in {}", NiceTimeSpanMs(Timer.GetElapsedTimeMs())); }); + const auto Guard = MakeGuard([&] { ZEN_INFO("collected garbage in {}", NiceTimeSpanMs(Timer.GetElapsedTimeMs())); }); for (GcStorage* Storage : m_GcStorage) { Storage->CollectGarbage(GcCtx); @@ -445,8 +445,7 @@ CasGc::CollectGarbage(GcContext& GcCtx) if (CidStore* CidStore = m_CidStore) { Stopwatch Timer; - const auto Guard = - MakeGuard([this, &Timer] { ZEN_INFO("clean up deleted content ids in {}", NiceTimeSpanMs(Timer.GetElapsedTimeMs())); }); + const auto Guard = MakeGuard([&] { ZEN_INFO("clean up deleted content ids in {}", NiceTimeSpanMs(Timer.GetElapsedTimeMs())); }); CidStore->RemoveCids(GcCtx.DeletedCas()); } } @@ -672,8 +671,7 @@ GcScheduler::SchedulerThread() NiceTimeSpanMs(uint64_t(std::chrono::duration_cast<std::chrono::milliseconds>(GcCtx.MaxCacheDuration()).count()))); { Stopwatch Timer; - const auto __ = - MakeGuard([this, &Timer] { ZEN_INFO("garbage collection DONE after {}", NiceTimeSpanMs(Timer.GetElapsedTimeMs())); }); + const auto __ = MakeGuard([&] { ZEN_INFO("garbage collection DONE after {}", NiceTimeSpanMs(Timer.GetElapsedTimeMs())); }); m_CasGc.CollectGarbage(GcCtx); |