From f1df1d1a51f310553fd8bcb831215307ec2609ae Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 7 Jan 2011 22:22:35 -0500 Subject: Don't allow circular_buffer to shrink below its original size when unit_sz is not a power of two --- src/rt/circular_buffer.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/rt/circular_buffer.h') diff --git a/src/rt/circular_buffer.h b/src/rt/circular_buffer.h index 9ddaba42..40fb1e24 100644 --- a/src/rt/circular_buffer.h +++ b/src/rt/circular_buffer.h @@ -24,6 +24,9 @@ public: size_t size(); private: + // Initial size of the buffer in bytes. + size_t _initial_sz; + // Size of the buffer in bytes, should always be a power of two so that // modulo arithmetic (x % _buffer_sz) can optimized away with // (x & (_buffer_sz - 1)). -- cgit v1.2.3