diff options
author | 2017-08-31 12:17:03 -0700 | |
---|---|---|
committer | 2017-08-31 12:17:03 -0700 | |
commit | 451b92a754900a800a7728a3d63462058026ac2c (patch) | |
tree | bcf56657ee104eefc918b634fff777285afe41d8 /src/core | |
parent | 8d51e8d17e012f81ca8e94c18f525e1781130481 (diff) | |
parent | 08b79c1611a1d8ae2f19937676aa0ad9df8c230b (diff) |
Merge pull request #12306 from kpayson64/ref_counting_slices
Give ownership of byte buffers to write ops
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/lib/transport/byte_stream.c | 1 | ||||
-rw-r--r-- | src/core/lib/transport/byte_stream.h | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/core/lib/transport/byte_stream.c b/src/core/lib/transport/byte_stream.c index fb03a10315..08f61629a9 100644 --- a/src/core/lib/transport/byte_stream.c +++ b/src/core/lib/transport/byte_stream.c @@ -85,6 +85,7 @@ static void slice_buffer_stream_shutdown(grpc_exec_ctx *exec_ctx, static void slice_buffer_stream_destroy(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream) { grpc_slice_buffer_stream *stream = (grpc_slice_buffer_stream *)byte_stream; + grpc_slice_buffer_reset_and_unref_internal(exec_ctx, stream->backing_buffer); GRPC_ERROR_UNREF(stream->shutdown_error); } diff --git a/src/core/lib/transport/byte_stream.h b/src/core/lib/transport/byte_stream.h index 1e1e8310b8..be2a35213e 100644 --- a/src/core/lib/transport/byte_stream.h +++ b/src/core/lib/transport/byte_stream.h @@ -81,7 +81,9 @@ void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx, // grpc_slice_buffer_stream // -// A grpc_byte_stream that wraps a slice buffer. +// A grpc_byte_stream that wraps a slice buffer. The stream takes +// ownership of the slices in the buffer, and on destruction will +// reset the contents of the buffer. typedef struct grpc_slice_buffer_stream { grpc_byte_stream base; |