| Index: courgette/streams.h
|
| ===================================================================
|
| --- courgette/streams.h (revision 80344)
|
| +++ courgette/streams.h (working copy)
|
| @@ -144,26 +144,20 @@
|
| // Writing to the stream invalidates the pointer. The SinkStream continues to
|
| // own the memory.
|
| const uint8* Buffer() const {
|
| - return reinterpret_cast<const uint8*>(buffer_.c_str());
|
| + return reinterpret_cast<const uint8*>(buffer_.data());
|
| }
|
|
|
| // Hints that the stream will grow by an additional |length| bytes.
|
| // Caller must be prepared to handle memory allocation problems.
|
| CheckBool Reserve(size_t length) {
|
| - buffer_.reserve(length + buffer_.length());
|
| - //TODO(tommi): return false when allocation fails.
|
| - return true;
|
| + return buffer_.reserve(length + buffer_.size());
|
| }
|
|
|
| // Finished with this stream and any storage it has.
|
| void Retire();
|
|
|
| private:
|
| - // Use a string to manage the stream's memory.
|
| - typedef std::basic_string<char,
|
| - std::char_traits<char>,
|
| - MemoryAllocator<char> > SinkBuffer;
|
| - SinkBuffer buffer_;
|
| + NoThrowBuffer<char> buffer_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(SinkStream);
|
| };
|
|
|