diff options
author | Vijay Pai <vpai@google.com> | 2018-12-14 13:52:25 -0800 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2018-12-14 13:52:25 -0800 |
commit | b0b4c0d9c36d9b3185c5b792ca6e8954ff065e54 (patch) | |
tree | ca22bc36faa24e2345fca7caba8a20c527599851 /include | |
parent | eb65dbb0304241a57d51b3b9f88a50de1f68a521 (diff) |
Add API comments indicating that byte buffer copy is size-independent
Diffstat (limited to 'include')
-rw-r--r-- | include/grpcpp/impl/codegen/byte_buffer.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/grpcpp/impl/codegen/byte_buffer.h b/include/grpcpp/impl/codegen/byte_buffer.h index 53ecb53371..a77e36dfc5 100644 --- a/include/grpcpp/impl/codegen/byte_buffer.h +++ b/include/grpcpp/impl/codegen/byte_buffer.h @@ -93,7 +93,9 @@ class ByteBuffer final { } /// Constuct a byte buffer by referencing elements of existing buffer - /// \a buf. Wrapper of core function grpc_byte_buffer_copy + /// \a buf. Wrapper of core function grpc_byte_buffer_copy . This is not + /// a deep copy; it is just a referencing. As a result, its performance is + /// size-independent. ByteBuffer(const ByteBuffer& buf); ~ByteBuffer() { @@ -102,6 +104,9 @@ class ByteBuffer final { } } + /// Wrapper of core function grpc_byte_buffer_copy . This is not + /// a deep copy; it is just a referencing. As a result, its performance is + /// size-independent. ByteBuffer& operator=(const ByteBuffer&); /// Dump (read) the buffer contents into \a slices. @@ -117,7 +122,9 @@ class ByteBuffer final { /// Make a duplicate copy of the internals of this byte /// buffer so that we have our own owned version of it. - /// bbuf.Duplicate(); is equivalent to bbuf=bbuf; but is actually readable + /// bbuf.Duplicate(); is equivalent to bbuf=bbuf; but is actually readable. + /// This is not a deep copy; it is a referencing and its performance + /// is size-independent. void Duplicate() { buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buffer_); } |