From 2400a76abf2e657037f82326d7814abd05fab900 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 26 Feb 2024 11:26:20 -0500 Subject: [PATCH] Update allocated to active in naming --- src/lib/support/Pool.cpp | 2 +- src/lib/support/Pool.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/support/Pool.cpp b/src/lib/support/Pool.cpp index ca88a715c6fec9..555127a7082d67 100644 --- a/src/lib/support/Pool.cpp +++ b/src/lib/support/Pool.cpp @@ -127,7 +127,7 @@ Loop StaticAllocatorBitmap::ForEachActiveObjectInner(void * context, Lambda lamb return Loop::Finish; } -size_t StaticAllocatorBitmap::FirstAllocatedIndex() +size_t StaticAllocatorBitmap::FirstActiveIndex() { size_t idx = 0; for (size_t word = 0; word * kBitChunkSize < Capacity(); ++word) diff --git a/src/lib/support/Pool.h b/src/lib/support/Pool.h index f1fb9401255f8e..fc4eb89275583b 100644 --- a/src/lib/support/Pool.h +++ b/src/lib/support/Pool.h @@ -94,14 +94,14 @@ class StaticAllocatorBitmap : public internal::StaticAllocatorBase void * At(size_t index) { return static_cast(mElements) + mElementSize * index; } size_t IndexOf(void * element); - /// Returns the first index that is allocated. + /// Returns the first index that is active (i.e. allocated data). /// - /// If nothing is allocated, this will return mCapacity - size_t FirstAllocatedIndex(); + /// If nothing is active, this will return mCapacity + size_t FirstActiveIndex(); /// Returns the next active index after `start`. /// - /// If nothing else allocated, returns mCapacity + /// If nothing else active/allocated, returns mCapacity size_t NextActiveIndexAfter(size_t start); using Lambda = Loop (*)(void * context, void * object); @@ -265,7 +265,7 @@ class BitMapObjectPool : public internal::StaticAllocatorBitmap BitMapObjectPool() : StaticAllocatorBitmap(mData.mMemory, mUsage, N, sizeof(T)) {} ~BitMapObjectPool() { VerifyOrDie(Allocated() == 0); } - BitmapActiveObjectIterator begin() { return BitmapActiveObjectIterator(this, FirstAllocatedIndex()); } + BitmapActiveObjectIterator begin() { return BitmapActiveObjectIterator(this, FirstActiveIndex()); } BitmapActiveObjectIterator end() { return BitmapActiveObjectIterator(this, N); } template