aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpcpp
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2018-12-14 15:18:01 -0800
committerGravatar GitHub <noreply@github.com>2018-12-14 15:18:01 -0800
commita8688d3bd37353e341330f8fdf1f24dd0a999cee (patch)
tree368845d437b882f0ac2985cfcef3f11a0aa47d90 /include/grpcpp
parent39bd784e3679b9318504160a0c7419a5f5ca1747 (diff)
parentb0b4c0d9c36d9b3185c5b792ca6e8954ff065e54 (diff)
Merge pull request #17510 from vjpai/bb_api
Add API comments indicating that byte buffer copy is size-independent
Diffstat (limited to 'include/grpcpp')
-rw-r--r--include/grpcpp/impl/codegen/byte_buffer.h11
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_);
}