aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc/slice_buffer.h
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-04-12 13:15:45 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-04-12 13:15:45 -0700
commit423d6fd7ed418aead7d494e8d3c31ecd6e2743f1 (patch)
treeb6ace176336e9206da6c0fd3ca7e1fe741687dad /include/grpc/slice_buffer.h
parent5a0cf3251580bd3ac57c5638be73edd4244a1210 (diff)
Optimize framing a little
- rely on the fact that data-to-come holds a reference to data-being-written, so there's no need to add a ref for every frame written - provide an 'inlined' version of grpc_slice_malloc (via a #define) that gives the compiler more information about small allocations to enable better optimization
Diffstat (limited to 'include/grpc/slice_buffer.h')
-rw-r--r--include/grpc/slice_buffer.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/grpc/slice_buffer.h b/include/grpc/slice_buffer.h
index 2ed896645b..cdbd74776c 100644
--- a/include/grpc/slice_buffer.h
+++ b/include/grpc/slice_buffer.h
@@ -77,6 +77,10 @@ GPRAPI void grpc_slice_buffer_trim_end(grpc_slice_buffer *src, size_t n,
/* move the first n bytes of src into dst */
GPRAPI void grpc_slice_buffer_move_first(grpc_slice_buffer *src, size_t n,
grpc_slice_buffer *dst);
+/* move the first n bytes of src into dst without adding references */
+GPRAPI void grpc_slice_buffer_move_first_no_ref(grpc_slice_buffer *src,
+ size_t n,
+ grpc_slice_buffer *dst);
/* move the first n bytes of src into dst (copying them) */
GPRAPI void grpc_slice_buffer_move_first_into_buffer(grpc_exec_ctx *exec_ctx,
grpc_slice_buffer *src,