diff options
Diffstat (limited to 'src/rt/circular_buffer.h')
| -rw-r--r-- | src/rt/circular_buffer.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rt/circular_buffer.h b/src/rt/circular_buffer.h index 2ebf23b0..3d11b37f 100644 --- a/src/rt/circular_buffer.h +++ b/src/rt/circular_buffer.h @@ -20,7 +20,9 @@ public: bool is_empty(); private: - // Size of the buffer in bytes. + // 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)). size_t _buffer_sz; // Size of the data unit in bytes. |