aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/transport/chttp2/transport/bin_decoder.c
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 /src/core/ext/transport/chttp2/transport/bin_decoder.c
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 'src/core/ext/transport/chttp2/transport/bin_decoder.c')
-rw-r--r--src/core/ext/transport/chttp2/transport/bin_decoder.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/ext/transport/chttp2/transport/bin_decoder.c b/src/core/ext/transport/chttp2/transport/bin_decoder.c
index 8c87de112e..21bed18c9a 100644
--- a/src/core/ext/transport/chttp2/transport/bin_decoder.c
+++ b/src/core/ext/transport/chttp2/transport/bin_decoder.c
@@ -169,7 +169,7 @@ grpc_slice grpc_chttp2_base64_decode(grpc_exec_ctx *exec_ctx,
}
}
}
- output = grpc_slice_malloc(output_length);
+ output = GRPC_SLICE_MALLOC(output_length);
ctx.input_cur = GRPC_SLICE_START_PTR(input);
ctx.input_end = GRPC_SLICE_END_PTR(input);
@@ -193,7 +193,7 @@ grpc_slice grpc_chttp2_base64_decode_with_length(grpc_exec_ctx *exec_ctx,
grpc_slice input,
size_t output_length) {
size_t input_length = GRPC_SLICE_LENGTH(input);
- grpc_slice output = grpc_slice_malloc(output_length);
+ grpc_slice output = GRPC_SLICE_MALLOC(output_length);
struct grpc_base64_decode_context ctx;
// The length of a base64 string cannot be 4 * n + 1