diff options
| author | Brian Anderson <[email protected]> | 2011-01-07 22:22:35 -0500 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-01-10 11:31:33 -0800 |
| commit | f1df1d1a51f310553fd8bcb831215307ec2609ae (patch) | |
| tree | 2fc8794122293e1bfd4c59a8f19f1c0eabdfd448 /src/rt/circular_buffer.h | |
| parent | Don't allow circular_buffer to shrink below it's initial size (diff) | |
| download | rust-f1df1d1a51f310553fd8bcb831215307ec2609ae.tar.xz rust-f1df1d1a51f310553fd8bcb831215307ec2609ae.zip | |
Don't allow circular_buffer to shrink below its original size when unit_sz is not a power of two
Diffstat (limited to 'src/rt/circular_buffer.h')
| -rw-r--r-- | src/rt/circular_buffer.h | 3 |
1 files changed, 3 insertions, 0 deletions
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)). |