aboutsummaryrefslogtreecommitdiff
path: root/src/rt/circular_buffer.h
diff options
context:
space:
mode:
authorMichael Bebenita <[email protected]>2010-07-19 17:33:50 -0700
committerMichael Bebenita <[email protected]>2010-07-19 17:33:50 -0700
commitc80483d582b995e7890a581e7de03c70c51df137 (patch)
treeef174a98cf18cfee3ec63b07a8b3a28554f2de51 /src/rt/circular_buffer.h
parentAdded a message passing system based on lock free queues for inter-thread com... (diff)
downloadrust-c80483d582b995e7890a581e7de03c70c51df137.tar.xz
rust-c80483d582b995e7890a581e7de03c70c51df137.zip
Fixed circular buffer resizing bug.
Diffstat (limited to 'src/rt/circular_buffer.h')
-rw-r--r--src/rt/circular_buffer.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/rt/circular_buffer.h b/src/rt/circular_buffer.h
index c0c0da5e..2ebf23b0 100644
--- a/src/rt/circular_buffer.h
+++ b/src/rt/circular_buffer.h
@@ -20,10 +20,19 @@ public:
bool is_empty();
private:
+ // Size of the buffer in bytes.
size_t _buffer_sz;
- size_t unit_sz;
+
+ // Size of the data unit in bytes.
+ size_t _unit_sz;
+
+ // Byte offset within the buffer where to read the next unit of data.
size_t _next;
+
+ // Number of bytes that have not been read from the buffer.
size_t _unread;
+
+ // The buffer itself.
uint8_t *_buffer;
};