address review feedback

pull/19792/head
Jan Tattermusch 5 years ago
parent 2f54647545
commit cb6d3a0623
  1. 2
      src/csharp/Grpc.Core/Internal/SliceBufferSafeHandle.cs
  2. 3
      src/csharp/ext/grpc_csharp_ext.c

@ -138,7 +138,7 @@ namespace Grpc.Core.Internal
// if no hint is provided, keep the available space within some "reasonable" boundaries.
// This is quite a naive approach which could use some fine-tuning, but currently in most case we know
// the required buffer size in advance anyway, so this approach seems good enough for now.
if (tailSpaceLen < DefaultTailSpaceSize /2 )
if (tailSpaceLen < DefaultTailSpaceSize / 2)
{
AdjustTailSpace(DefaultTailSpaceSize);
}

@ -44,8 +44,7 @@
static grpc_byte_buffer* grpcsharp_create_byte_buffer_from_stolen_slices(
grpc_slice_buffer* slice_buffer) {
grpc_byte_buffer* bb =
(grpc_byte_buffer*)gpr_malloc(sizeof(grpc_byte_buffer));
memset(bb, 0, sizeof(grpc_byte_buffer));
(grpc_byte_buffer*)gpr_zalloc(sizeof(grpc_byte_buffer));
bb->type = GRPC_BB_RAW;
bb->data.raw.compression = GRPC_COMPRESS_NONE;
grpc_slice_buffer_init(&bb->data.raw.slice_buffer);

Loading…
Cancel
Save