diff options
author | Craig Tiller <ctiller@google.com> | 2017-04-12 13:15:45 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-04-12 13:15:45 -0700 |
commit | 423d6fd7ed418aead7d494e8d3c31ecd6e2743f1 (patch) | |
tree | b6ace176336e9206da6c0fd3ca7e1fe741687dad /include/grpc/slice_buffer.h | |
parent | 5a0cf3251580bd3ac57c5638be73edd4244a1210 (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.h | 4 |
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, |