aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/slice/slice.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lib/slice/slice.cc')
-rw-r--r--src/core/lib/slice/slice.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/core/lib/slice/slice.cc b/src/core/lib/slice/slice.cc
index 1eb15290eb..bbaf87ba23 100644
--- a/src/core/lib/slice/slice.cc
+++ b/src/core/lib/slice/slice.cc
@@ -54,9 +54,9 @@ grpc_slice grpc_slice_ref_internal(grpc_slice slice) {
return slice;
}
-void grpc_slice_unref_internal(grpc_slice slice) {
+void grpc_slice_unref_internal(grpc_exec_ctx* exec_ctx, grpc_slice slice) {
if (slice.refcount) {
- slice.refcount->vtable->unref(slice.refcount);
+ slice.refcount->vtable->unref(exec_ctx, slice.refcount);
}
}
@@ -67,14 +67,15 @@ grpc_slice grpc_slice_ref(grpc_slice slice) {
/* Public API */
void grpc_slice_unref(grpc_slice slice) {
- grpc_core::ExecCtx exec_ctx;
- grpc_slice_unref_internal(slice);
+ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_slice_unref_internal(&exec_ctx, slice);
+ grpc_exec_ctx_finish(&exec_ctx);
}
/* grpc_slice_from_static_string support structure - a refcount that does
nothing */
static void noop_ref(void* unused) {}
-static void noop_unref(void* unused) {}
+static void noop_unref(grpc_exec_ctx* exec_ctx, void* unused) {}
static const grpc_slice_refcount_vtable noop_refcount_vtable = {
noop_ref, noop_unref, grpc_slice_default_eq_impl,
@@ -108,7 +109,7 @@ static void new_slice_ref(void* p) {
gpr_ref(&r->refs);
}
-static void new_slice_unref(void* p) {
+static void new_slice_unref(grpc_exec_ctx* exec_ctx, void* p) {
new_slice_refcount* r = (new_slice_refcount*)p;
if (gpr_unref(&r->refs)) {
r->user_destroy(r->user_data);
@@ -158,7 +159,7 @@ static void new_with_len_ref(void* p) {
gpr_ref(&r->refs);
}
-static void new_with_len_unref(void* p) {
+static void new_with_len_unref(grpc_exec_ctx* exec_ctx, void* p) {
new_with_len_slice_refcount* r = (new_with_len_slice_refcount*)p;
if (gpr_unref(&r->refs)) {
r->user_destroy(r->user_data, r->user_length);
@@ -209,7 +210,7 @@ static void malloc_ref(void* p) {
gpr_ref(&r->refs);
}
-static void malloc_unref(void* p) {
+static void malloc_unref(grpc_exec_ctx* exec_ctx, void* p) {
malloc_refcount* r = (malloc_refcount*)p;
if (gpr_unref(&r->refs)) {
gpr_free(r);