/[Apache-SVN]
ViewVC logotype

Revision 665454


Jump to revision: Previous Next
Author: dreiss
Date: Sat Feb 2 00:54:48 2008 UTC (16 years, 9 months ago)
Changed paths: 6
Log Message:
Thrift: Update the interface for TTransport's "borrow" method.

Summary:
I don't know what I was thinking when I first wrote this.
It makes sense that the transport might not want to allocate its own memory,
so the protocol is expected to provide a buffer for the data.
However, if the transport already has the data buffered,
there is no need to memcpy it; it can just return a pointer into its buffer.
The new interface still requires the protocol to provide a buffer,
but allows the transport to return a pointer to an interal buffer.
In addition, I made len a pass-by-pointer parameter so that
the transport can return more than the requested data if it has it
available in its buffers.

Reviewed By: mcslee

Test Plan: Ran the DenseProtocol test and the Zlib test.

Revert Plan: ok

Other Notes:
Also got this reviewed by Chad Walters from Powerset.
Ben Maurer suggested making len a reference parameter.


Changed paths

Path Details
Directoryincubator/thrift/trunk/lib/cpp/src/protocol/TDenseProtocol.cpp modified , text changed
Directoryincubator/thrift/trunk/lib/cpp/src/transport/TTransport.h modified , text changed
Directoryincubator/thrift/trunk/lib/cpp/src/transport/TTransportUtils.cpp modified , text changed
Directoryincubator/thrift/trunk/lib/cpp/src/transport/TTransportUtils.h modified , text changed
Directoryincubator/thrift/trunk/lib/cpp/src/transport/TZlibTransport.cpp modified , text changed
Directoryincubator/thrift/trunk/lib/cpp/src/transport/TZlibTransport.h modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26