[PATCH] [ring_buffer.h] Improve commentary for RingBuffer (#5518)
authorRamana Radhakrishnan <ramana.radhakrishnan@arm.com>
Tue, 5 May 2020 23:47:10 +0000 (00:47 +0100)
committerGitHub <noreply@github.com>
Tue, 5 May 2020 23:47:10 +0000 (16:47 -0700)
bytes_available refers to the number of bytes used in the ring
buffer. At the same time, fix a typo.

src/support/ring_buffer.h

index 7a1bcb6..d3227ad 100644 (file)
@@ -149,7 +149,7 @@ class RingBuffer {
     bytes_available_ += size;
   }
   /*!
-   * \brief Writen data into the buffer by give it a non-blocking callback function.
+   * \brief Written data into the buffer by give it a non-blocking callback function.
    *
    * \param frecv A receive function handle
    * \param max_nbytes Maximum number of bytes can write.
@@ -180,9 +180,9 @@ class RingBuffer {
  private:
   // buffer head
   size_t head_ptr_{0};
-  // number of bytes in the buffer.
+  // number of bytes occupied in the buffer.
   size_t bytes_available_{0};
-  // The internalata ring.
+  // The internal data ring.
   std::vector<char> ring_;
 };
 }  // namespace support