summaryrefslogtreecommitdiff
path: root/lib/buffer_queue_circ.cpp
diff options
context:
space:
mode:
authorJosh Blum2013-02-28 21:06:30 -0600
committerJosh Blum2013-02-28 21:06:30 -0600
commit2f2abb4102d442e88ea6b9a63c4c149943832eed (patch)
tree0b0e29868e50cac8315d6fd39fe58add4b504512 /lib/buffer_queue_circ.cpp
parentd585a4132cb29aa1d943c7bfba82dcaef8487bac (diff)
downloadsandhi-2f2abb4102d442e88ea6b9a63c4c149943832eed.tar.gz
sandhi-2f2abb4102d442e88ea6b9a63c4c149943832eed.tar.bz2
sandhi-2f2abb4102d442e88ea6b9a63c4c149943832eed.zip
gras: added asserts to circ buffer queue
Diffstat (limited to 'lib/buffer_queue_circ.cpp')
-rw-r--r--lib/buffer_queue_circ.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/buffer_queue_circ.cpp b/lib/buffer_queue_circ.cpp
index 61cba1f..77dcd60 100644
--- a/lib/buffer_queue_circ.cpp
+++ b/lib/buffer_queue_circ.cpp
@@ -85,6 +85,8 @@ SBuffer &BufferQueueCirc::front(void)
ASSERT(front);
front->config.memory = _write_ptr;
front.last = _last_ptr;
+ ASSERT(front.offset == 0);
+ if (_last_ptr == _write_ptr) ASSERT(front.get() == front.last);
return front;
}
@@ -92,6 +94,7 @@ void BufferQueueCirc::pop(void)
{
ASSERT(not this->empty());
SBuffer &front = _available_buffers.front();
+ ASSERT(front.length == 0);
const size_t num_bytes = front.offset;
//store number of bytes for buffer return