aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compiler
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-04-05 15:41:59 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-04-05 15:41:59 -0700
commitd4e9a4863a25f40389db01347aaabcb798dc9138 (patch)
treee32718193aec49c2f7995fdc474a30b2a5b1b238 /src/compiler
parentfa416cbe3ba9b2f31666932235407c1c7d5e4e6f (diff)
Convert all async client stream types to not allocate
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/cpp_generator.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc
index 34d641f738..4cc6a4cf39 100644
--- a/src/compiler/cpp_generator.cc
+++ b/src/compiler/cpp_generator.cc
@@ -1129,7 +1129,7 @@ void PrintSourceClientMethod(grpc_generator::Printer *printer,
"::grpc::ClientContext* context, $Response$* response, "
"::grpc::CompletionQueue* cq, void* tag) {\n");
printer->Print(*vars,
- " return new ::grpc::ClientAsyncWriter< $Request$>("
+ " return ::grpc::ClientAsyncWriter< $Request$>::Create("
"channel_.get(), cq, "
"rpcmethod_$Method$_, "
"context, response, tag);\n"
@@ -1152,7 +1152,7 @@ void PrintSourceClientMethod(grpc_generator::Printer *printer,
"::grpc::ClientContext* context, const $Request$& request, "
"::grpc::CompletionQueue* cq, void* tag) {\n");
printer->Print(*vars,
- " return new ::grpc::ClientAsyncReader< $Response$>("
+ " return ::grpc::ClientAsyncReader< $Response$>::Create("
"channel_.get(), cq, "
"rpcmethod_$Method$_, "
"context, request, tag);\n"
@@ -1174,13 +1174,14 @@ void PrintSourceClientMethod(grpc_generator::Printer *printer,
"::grpc::ClientAsyncReaderWriter< $Request$, $Response$>* "
"$ns$$Service$::Stub::Async$Method$Raw(::grpc::ClientContext* context, "
"::grpc::CompletionQueue* cq, void* tag) {\n");
- printer->Print(*vars,
- " return new "
- "::grpc::ClientAsyncReaderWriter< $Request$, $Response$>("
- "channel_.get(), cq, "
- "rpcmethod_$Method$_, "
- "context, tag);\n"
- "}\n\n");
+ printer->Print(
+ *vars,
+ " return "
+ "::grpc::ClientAsyncReaderWriter< $Request$, $Response$>::Create("
+ "channel_.get(), cq, "
+ "rpcmethod_$Method$_, "
+ "context, tag);\n"
+ "}\n\n");
}
}