Explain intent of condition

This commit is contained in:
2024-05-04 12:02:55 -07:00
parent 8e1faadd30
commit bfbe9638eb

View File

@@ -105,6 +105,8 @@ struct RootSet::Impl {
void setOldestVersion(int64_t oldestVersion) {
this->oldestVersion = oldestVersion;
// This condition is basically "while it would be incorrect to read
// firstToFree at oldestVersion - 1"
while (firstToFree != nullptr && firstToFree->next != nullptr &&
firstToFree->next->versions()[firstToFree->next->end.load(
std::memory_order_relaxed) -