Index: third_party/grpc/examples/csharp/helloworld/GreeterClient/Program.cs |
diff --git a/third_party/tcmalloc/vendor/src/tcmalloc_guard.h b/third_party/grpc/examples/csharp/helloworld/GreeterClient/Program.cs |
similarity index 69% |
copy from third_party/tcmalloc/vendor/src/tcmalloc_guard.h |
copy to third_party/grpc/examples/csharp/helloworld/GreeterClient/Program.cs |
index 7874dadaea9882b49a015ef5e125345d89e71e95..ffc7fabbf12ac68ef39474203dcc261c08ddbe4c 100644 |
--- a/third_party/tcmalloc/vendor/src/tcmalloc_guard.h |
+++ b/third_party/grpc/examples/csharp/helloworld/GreeterClient/Program.cs |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2005, Google Inc. |
+// Copyright 2015-2016, Google Inc. |
// All rights reserved. |
// |
// Redistribution and use in source and binary forms, with or without |
@@ -27,22 +27,27 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// --- |
-// Author: Craig Silverstein |
-// |
-// We expose the TCMallocGuard class -- which initializes the tcmalloc |
-// allocator -- so classes that need to be sure tcmalloc is loaded |
-// before they do stuff -- notably heap-profiler -- can. To use this |
-// create a static TCMallocGuard instance at the top of a file where |
-// you need tcmalloc to be initialized before global constructors run. |
+using System; |
+using Grpc.Core; |
+using Helloworld; |
+ |
+namespace GreeterClient |
+{ |
+ class Program |
+ { |
+ public static void Main(string[] args) |
+ { |
+ Channel channel = new Channel("127.0.0.1:50051", ChannelCredentials.Insecure); |
-#ifndef TCMALLOC_TCMALLOC_GUARD_H_ |
-#define TCMALLOC_TCMALLOC_GUARD_H_ |
+ var client = Greeter.NewClient(channel); |
+ String user = "you"; |
-class TCMallocGuard { |
- public: |
- TCMallocGuard(); |
- ~TCMallocGuard(); |
-}; |
+ var reply = client.SayHello(new HelloRequest { Name = user }); |
+ Console.WriteLine("Greeting: " + reply.Message); |
-#endif // TCMALLOC_TCMALLOC_GUARD_H_ |
+ channel.ShutdownAsync().Wait(); |
+ Console.WriteLine("Press any key to exit..."); |
+ Console.ReadKey(); |
+ } |
+ } |
+} |