On Saturday, October 28, 2017 at 10:00:45 AM UTC-7, Vijay Pai wrote: > grpc::Slice drops a reference to the underlying grpc_slice at destruction > time; if you use that in combination with the StealRef second argument, I > think that you would have what you essentially want. (FWIW, the > constructor for grpc::Slice that takes a grpc_slice is not really > recommended since grpc_slice itself is core API which changes a lot more > rapidly than C++ API).
Thanks for the pointer. I see it, and it helps cover one place where I was missing exception safety. > grpc::ByteBuffer uses grpc_byte_buffer in its implementation but does not > have a constructor that takes in a grpc_byte_buffer. There is an issue > filed to improve the characteristics of grpc::ByteBuffer but no > consideration of adding a constructor that pulls from a grpc_byte_buffer > (again, since C++ API should avoid requiring the use of core API > features). The version I'm using is behind a bit, so I don't yet have commit 87973ea398 [1] that added support for using ByteBuffer to implement SerializationTraits. Once I can pick that up, I can switch to ByteBuffer, so my use case doesn't need a grpc_byte_buffer ctor either. The improvements proposed in issue #12296 [2] will help with my implementation of SerializationTraits, so I'm looking forward to them. [1]: https://github.com/grpc/grpc/commit/87973ea3981af6b73dfc8c08bcb6d3ebf01ce4a0 [2]: https://github.com/grpc/grpc/issues/12296 -- Christopher Warrington Microsoft -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/cefeb703-ef57-4bbb-8528-f6277abc00a9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
