about summary refs log tree commit diff
path: root/src/rt/circular_buffer.cpp
diff options
context:
space:
mode:
authorMichael Bebenita <mbebenita@mozilla.com>2010-07-28 00:01:31 -0700
committerGraydon Hoare <graydon@mozilla.com>2010-07-28 20:30:29 -0700
commitc5e0ea727634cabda067c80520946eed7579cd96 (patch)
treefcc140852b404ec4cc638c3c2c3c77d4f0591756 /src/rt/circular_buffer.cpp
parentd6cba83322fe1cb03b730bee89a5c8d7a3b5e67c (diff)
downloadrust-c5e0ea727634cabda067c80520946eed7579cd96.tar.gz
rust-c5e0ea727634cabda067c80520946eed7579cd96.zip
Add comment explaining NULL case in circular_buffer::enqueue and add logging to ::dequeue.
Diffstat (limited to 'src/rt/circular_buffer.cpp')
-rw-r--r--src/rt/circular_buffer.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rt/circular_buffer.cpp b/src/rt/circular_buffer.cpp
index 640809e048f..1b626920694 100644
--- a/src/rt/circular_buffer.cpp
+++ b/src/rt/circular_buffer.cpp
@@ -91,7 +91,8 @@ circular_buffer::enqueue(void *src) {
 
 /**
  * Copies data from this buffer to the "dst" address. The buffer is
- * shrunk if possible.
+ * shrunk if possible. If the "dst" address is NULL, then the message
+ * is dequeued but is not copied.
  */
 void
 circular_buffer::dequeue(void *dst) {
@@ -100,6 +101,11 @@ circular_buffer::dequeue(void *dst) {
     I(dom, _unread <= _buffer_sz);
     I(dom, _buffer);
 
+    dom->log(rust_log::MEM | rust_log::COMM,
+             "circular_buffer dequeue "
+             "unread: %d, buffer_sz: %d, unit_sz: %d",
+             _unread, _buffer_sz, unit_sz);
+
     if (dst != NULL) {
         memcpy(dst, &_buffer[_next], unit_sz);
     }