Minimize copying of large sequence<byte> parameters
The above documentation link suggests using ["cpp:array"] Ice::ByteSeq instead of sequence to minimize copying of data, saying:
“the [std::pair<…>] pointers point directly into the server-side transport buffer; this allows the server-side run time to avoid creating a vector to pass to the operation implementation, thereby avoiding both allocating memory for the sequence and copying its contents into that memory.”
For our application, we’d like to extend the life-cycle of the passed-in data beyond the return of the servant method. I don’t quite understand why, for raw bytes, the server-side run time cannot dump the transport data directly into the dynamically allocated memory of the vector<> container, thus getting zero-copy performance while allowing efficient vector swap/move semantics to be used to extend the life-cycle of the passed-in data.
Going one step further with the std::vector<> class, it would be good if a specialized allocator_type could be specified for vector construction, which happens inside the ICE run time. It that possible?