diff options
author | Vijay Pai <vpai@google.com> | 2017-08-03 13:05:42 -0700 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2017-08-04 07:48:48 -0700 |
commit | ce58cf8c44c9d41b50f85a9b87337f0736022e7a (patch) | |
tree | a29cd0a135489af9cbb944bf35bd967b774c8a4b /src/cpp | |
parent | 3e6df473bfc7cd8c37c88e46298ee9ed40634cfd (diff) |
Add Slice constructors to match all grpc_slice cases
Diffstat (limited to 'src/cpp')
-rw-r--r-- | src/cpp/util/slice_cc.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cpp/util/slice_cc.cc b/src/cpp/util/slice_cc.cc index 56e0328b94..486d0cdf0e 100644 --- a/src/cpp/util/slice_cc.cc +++ b/src/cpp/util/slice_cc.cc @@ -17,6 +17,7 @@ */ #include <grpc++/support/slice.h> +#include <grpc/slice.h> namespace grpc { @@ -43,4 +44,10 @@ Slice::Slice(const void* buf, size_t len, StaticSlice) Slice::Slice(const Slice& other) : slice_(grpc_slice_ref(other.slice_)) {} +Slice::Slice(void* buf, size_t len, void (*destroy)(void*), void* user_data) + : slice_(grpc_slice_new_with_user_data(buf, len, destroy, user_data)) {} + +Slice::Slice(void* buf, size_t len, void (*destroy)(void*, size_t)) + : slice_(grpc_slice_new_with_len(buf, len, destroy)) {} + } // namespace grpc |