Commit 5c2f880f authored by Xavier Thompson's avatar Xavier Thompson

Revert broken "deque.hpp: Improve shrink implementation"

This reverts commit daed60ee.
parent d7cda810
......@@ -69,24 +69,7 @@ namespace typon::fdt::lock_free
ring_buffer * shrink(u64 start, u64 end) noexcept
{
ring_buffer * last = nullptr;
ring_buffer * next = this;
u64 size = end - start;
while (auto buff = next->_next)
{
if (buff->capacity() < size * 4)
{
break;
}
last = next;
next = buff;
}
if (!last)
{
return nullptr;
}
last->_next = nullptr;
return fill(next, start, end);
return fill(std::exchange(_next, nullptr), start, end);
}
};
......
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