Skip to content

Commit

Permalink
iox-#2044 Fix initialization of 'FixedPositionContainer'
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Oct 21, 2023
1 parent 64f44a0 commit cd13569
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,18 @@ namespace iox
template <typename T, uint64_t CAPACITY>
inline FixedPositionContainer<T, CAPACITY>::FixedPositionContainer() noexcept
{
clear();
for (IndexType i = 0; i < CAPACITY;)
{
m_slots[i].status = SlotStatus::FREE;

IndexType next = static_cast<IndexType>(i + 1U);
m_slots[i].next = next;
i = next;
}
m_slots[Index::LAST].next = Index::INVALID;

m_begin_free = Index::FIRST;
m_begin_used = Index::INVALID;
}

template <typename T, uint64_t CAPACITY>
Expand Down

0 comments on commit cd13569

Please sign in to comment.