Closed randomuserhi closed 1 month ago
Thanks for reporting! It seems that Jolt is not using that code path. Note that I see FixedSizeFreeList as an internal type and didn't expect anyone to use it. What are you using it for?
I'm actually not using it, but instead reading through your implementation as a learning exercise and just happened to stumble upon it by pure chance!
Creating a
FixedSizeFreeList
of an item with a non-trivial destructor causes this while loop to run forever:This is because
FixedSizeFreeList<T>::AddObjectToBatch
never sets the last item in the batch linked list tocInvalidObjectIndex
. referenceEither the last object in the batch needs to have
mNextFreeObject
set tocInvalidObjectIndex
or the while loop inFixedSizeFreeList<T>::DestructObjectBatch
needs to check the index is not equal to the batch's last index, also ensuring to do the last item (Simply changing the loop towhile (object_idx != ioBatch.mLastObjectIndex)
will skip the last item). UsingioBatch.size
is another potential fix: For example, replacing the snippet here with: