GPR_GLOBAL_CONFIG_DEFINE_BOOL(grpc_enable_fork_support,
GRPC_ENABLE_FORK_SUPPORT_DEFAULT,
- "Enable folk support");
+ "Enable fork support");
namespace grpc_core {
namespace internal {
// When blocked, the exec_ctx_count is 0-indexed. Note that ExecCtx
// creation can only be blocked if there is exactly 1 outstanding ExecCtx,
// meaning that BLOCKED and UNBLOCKED counts partition the integers
-#define UNBLOCKED(n) (n + 2)
+#define UNBLOCKED(n) ((n) + 2)
#define BLOCKED(n) (n)
class ExecCtxState {
int count_;
};
-} // namespace
+} // namespace internal
void Fork::GlobalInit() {
if (!override_enabled_) {
MemoryOrder::RELAXED);
}
if (support_enabled_.Load(MemoryOrder::RELAXED)) {
- exec_ctx_state_ = grpc_core::New<internal::ExecCtxState>();
- thread_state_ = grpc_core::New<internal::ThreadState>();
+ exec_ctx_state_ = new internal::ExecCtxState();
+ thread_state_ = new internal::ThreadState();
}
}
void Fork::GlobalShutdown() {
if (support_enabled_.Load(MemoryOrder::RELAXED)) {
- grpc_core::Delete(exec_ctx_state_);
- grpc_core::Delete(thread_state_);
+ delete exec_ctx_state_;
+ delete thread_state_;
}
}