From 4dde8b277d5196962f5c08afd39db94f50242c29 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 13 Feb 2017 12:44:14 -0800 Subject: [PATCH] Fix stack corruption --- test/cpp/microbenchmarks/bm_closure.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/cpp/microbenchmarks/bm_closure.cc b/test/cpp/microbenchmarks/bm_closure.cc index dac7d9c6779..80d6610e13b 100644 --- a/test/cpp/microbenchmarks/bm_closure.cc +++ b/test/cpp/microbenchmarks/bm_closure.cc @@ -324,7 +324,8 @@ class Rescheduler { static void BM_ClosureReschedOnExecCtx(benchmark::State& state) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - Rescheduler(state, grpc_schedule_on_exec_ctx).ScheduleFirst(&exec_ctx); + Rescheduler r(state, grpc_schedule_on_exec_ctx); + r.ScheduleFirst(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx); } BENCHMARK(BM_ClosureReschedOnExecCtx); @@ -332,8 +333,8 @@ BENCHMARK(BM_ClosureReschedOnExecCtx); static void BM_ClosureReschedOnCombiner(benchmark::State& state) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_combiner* combiner = grpc_combiner_create(NULL); - Rescheduler(state, grpc_combiner_scheduler(combiner, false)) - .ScheduleFirst(&exec_ctx); + Rescheduler r(state, grpc_combiner_scheduler(combiner, false)); + r.ScheduleFirst(&exec_ctx); grpc_exec_ctx_flush(&exec_ctx); GRPC_COMBINER_UNREF(&exec_ctx, combiner, "finished"); grpc_exec_ctx_finish(&exec_ctx); @@ -343,9 +344,9 @@ BENCHMARK(BM_ClosureReschedOnCombiner); static void BM_ClosureReschedOnCombinerFinally(benchmark::State& state) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_combiner* combiner = grpc_combiner_create(NULL); - Rescheduler(state, grpc_combiner_finally_scheduler(combiner, false)) - .ScheduleFirstAgainstDifferentScheduler( - &exec_ctx, grpc_combiner_scheduler(combiner, false)); + Rescheduler r(state, grpc_combiner_finally_scheduler(combiner, false)); + r.ScheduleFirstAgainstDifferentScheduler( + &exec_ctx, grpc_combiner_scheduler(combiner, false)); grpc_exec_ctx_flush(&exec_ctx); GRPC_COMBINER_UNREF(&exec_ctx, combiner, "finished"); grpc_exec_ctx_finish(&exec_ctx);