Skip to content
Snippets Groups Projects
Commit 7fa7d681 authored by Craig Tiller's avatar Craig Tiller
Browse files

Fix core banned functions

parent 0cf6a71b
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment