mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-30 09:35:40 +00:00
FIFOQueue: Fix contiguous space with full buffer
This commit is contained in:
parent
47b390e356
commit
dbe5f3c30c
|
@ -23,7 +23,15 @@ public:
|
||||||
T* GetWritePointer() { return &m_ptr[m_tail]; }
|
T* GetWritePointer() { return &m_ptr[m_tail]; }
|
||||||
u32 GetSize() const { return m_size; }
|
u32 GetSize() const { return m_size; }
|
||||||
u32 GetSpace() const { return CAPACITY - m_size; }
|
u32 GetSpace() const { return CAPACITY - m_size; }
|
||||||
u32 GetContiguousSpace() const { return (m_tail >= m_head) ? (CAPACITY - m_tail) : (m_head - m_tail); }
|
u32 GetContiguousSpace() const
|
||||||
|
{
|
||||||
|
if (m_tail == m_head && m_size > 0)
|
||||||
|
return 0;
|
||||||
|
else if (m_tail >= m_head)
|
||||||
|
return (CAPACITY - m_tail);
|
||||||
|
else
|
||||||
|
return (m_head - m_tail);
|
||||||
|
}
|
||||||
u32 GetContiguousSize() const { return std::min<u32>(CAPACITY - m_head, m_size); }
|
u32 GetContiguousSize() const { return std::min<u32>(CAPACITY - m_head, m_size); }
|
||||||
bool IsEmpty() const { return m_size == 0; }
|
bool IsEmpty() const { return m_size == 0; }
|
||||||
bool IsFull() const { return m_size == CAPACITY; }
|
bool IsFull() const { return m_size == CAPACITY; }
|
||||||
|
|
Loading…
Reference in a new issue