aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-01-20 16:01:43 -0800
committerGravatar Craig Tiller <ctiller@google.com>2017-01-20 16:01:43 -0800
commit7fa7d6817ef99cdf75690b55962c44b40f09a700 (patch)
tree0b4bec2b166bec1a7e928087043ee11d95cf9655
parent0cf6a71b7206ab7562c814bdd35a79fcfc9ec598 (diff)
Fix core banned functions
-rw-r--r--include/grpc/slice_buffer.h3
-rw-r--r--src/core/lib/slice/slice_buffer.c7
2 files changed, 6 insertions, 4 deletions
diff --git a/include/grpc/slice_buffer.h b/include/grpc/slice_buffer.h
index ebd0db7620..2ed896645b 100644
--- a/include/grpc/slice_buffer.h
+++ b/include/grpc/slice_buffer.h
@@ -78,7 +78,8 @@ GPRAPI void grpc_slice_buffer_trim_end(grpc_slice_buffer *src, size_t n,
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 (copying them) */
-GPRAPI void grpc_slice_buffer_move_first_into_buffer(grpc_slice_buffer *src,
+GPRAPI void grpc_slice_buffer_move_first_into_buffer(grpc_exec_ctx *exec_ctx,
+ grpc_slice_buffer *src,
size_t n, void *dst);
/* take the first slice in the slice buffer */
GPRAPI grpc_slice grpc_slice_buffer_take_first(grpc_slice_buffer *src);
diff --git a/src/core/lib/slice/slice_buffer.c b/src/core/lib/slice/slice_buffer.c
index b1bf0ceb23..9176dc8a42 100644
--- a/src/core/lib/slice/slice_buffer.c
+++ b/src/core/lib/slice/slice_buffer.c
@@ -282,7 +282,8 @@ void grpc_slice_buffer_move_first(grpc_slice_buffer *src, size_t n,
GPR_ASSERT(src->count > 0);
}
-void grpc_slice_buffer_move_first_into_buffer(grpc_slice_buffer *src, size_t n,
+void grpc_slice_buffer_move_first_into_buffer(grpc_exec_ctx *exec_ctx,
+ grpc_slice_buffer *src, size_t n,
void *dst) {
char *dstp = dst;
GPR_ASSERT(src->length >= n);
@@ -297,13 +298,13 @@ void grpc_slice_buffer_move_first_into_buffer(grpc_slice_buffer *src, size_t n,
n = 0;
} else if (slice_len == n) {
memcpy(dstp, GRPC_SLICE_START_PTR(slice), n);
- grpc_slice_unref(slice);
+ grpc_slice_unref_internal(exec_ctx, slice);
n = 0;
} else {
memcpy(dstp, GRPC_SLICE_START_PTR(slice), slice_len);
dstp += slice_len;
n -= slice_len;
- grpc_slice_unref(slice);
+ grpc_slice_unref_internal(exec_ctx, slice);
}
}
}