Merge pull request #14890 from yashykt/execctx_cleanup

Remove exec_ctx from slice and slice buffer
pull/14859/merge
Yash Tibrewal 7 years ago committed by GitHub
commit 09d6e8cbc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/core/lib/slice/slice.cc
  2. 16
      src/core/lib/slice/slice_buffer.cc

@ -69,8 +69,12 @@ 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);
if (grpc_core::ExecCtx::Get() == nullptr) {
grpc_core::ExecCtx exec_ctx;
grpc_slice_unref_internal(slice);
} else {
grpc_slice_unref_internal(slice);
}
}
/* grpc_slice_from_static_string support structure - a refcount that does

@ -75,8 +75,12 @@ void grpc_slice_buffer_destroy_internal(grpc_slice_buffer* sb) {
}
void grpc_slice_buffer_destroy(grpc_slice_buffer* sb) {
grpc_core::ExecCtx exec_ctx;
grpc_slice_buffer_destroy_internal(sb);
if (grpc_core::ExecCtx::Get() == nullptr) {
grpc_core::ExecCtx exec_ctx;
grpc_slice_buffer_destroy_internal(sb);
} else {
grpc_slice_buffer_destroy_internal(sb);
}
}
uint8_t* grpc_slice_buffer_tiny_add(grpc_slice_buffer* sb, size_t n) {
@ -176,8 +180,12 @@ void grpc_slice_buffer_reset_and_unref_internal(grpc_slice_buffer* sb) {
}
void grpc_slice_buffer_reset_and_unref(grpc_slice_buffer* sb) {
grpc_core::ExecCtx exec_ctx;
grpc_slice_buffer_reset_and_unref_internal(sb);
if (grpc_core::ExecCtx::Get() == nullptr) {
grpc_core::ExecCtx exec_ctx;
grpc_slice_buffer_reset_and_unref_internal(sb);
} else {
grpc_slice_buffer_reset_and_unref_internal(sb);
}
}
void grpc_slice_buffer_swap(grpc_slice_buffer* a, grpc_slice_buffer* b) {

Loading…
Cancel
Save