Commit f179573d authored by Xavier Thompson's avatar Xavier Thompson

gc.hpp: Optimise list traversal

parent 4af7e5f3
...@@ -109,7 +109,8 @@ namespace typon::fdt::lock_free ...@@ -109,7 +109,8 @@ namespace typon::fdt::lock_free
void reclaim(u64 oldest) noexcept void reclaim(u64 oldest) noexcept
{ {
while (auto tail = _tail.load()) auto tail = _tail.load();
while (tail)
{ {
if (tail->_stamp >= oldest) if (tail->_stamp >= oldest)
{ {
...@@ -123,6 +124,7 @@ namespace typon::fdt::lock_free ...@@ -123,6 +124,7 @@ namespace typon::fdt::lock_free
if (_tail.compare_exchange_strong(tail, next)) if (_tail.compare_exchange_strong(tail, next))
{ {
delete tail; delete tail;
tail = next;
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment