ivanallen commented on code in PR #3062:
URL: https://github.com/apache/brpc/pull/3062#discussion_r2271940296


##########
src/butil/iobuf.h:
##########
@@ -545,6 +547,47 @@ class IOBufCutter {
     IOBuf* _buf;
 };
 
+// SingleIOBuf is a lightweight buffer that manages a single IOBuf::Block.
+// It always ensures that the underlying memory is contiguous and 
+// avoids unnecessary memory copies through.
+// It is primarily used to efficiently serialize and deserialize 
+// RPC requests in flatbuffers.
+class SingleIOBuf {
+public:
+    SingleIOBuf();
+    ~SingleIOBuf();
+    SingleIOBuf(const IOBuf::BlockRef& ref);
+    SingleIOBuf(const SingleIOBuf& other);
+    SingleIOBuf& operator=(const SingleIOBuf& rhs);
+    void* alloc(uint32_t size);

Review Comment:
   Why not use `allocate`?It will correspond to `deallocate` below.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to