Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1115)

Unified Diff: courgette/streams.h

Issue 6602017: Merge 75787 - Improved memory usage while applying patch.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/648/src/
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « courgette/ensemble_create.cc ('k') | courgette/streams.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/streams.h
===================================================================
--- courgette/streams.h (revision 76288)
+++ courgette/streams.h (working copy)
@@ -147,6 +147,9 @@
// Hints that the stream will grow by an additional |length| bytes.
void Reserve(size_t length) { buffer_.reserve(length + buffer_.length()); }
+ // Finished with this stream and any storage it has.
+ void Retire();
+
private:
std::string buffer_; // Use a string to manage the stream's memory.
@@ -187,6 +190,11 @@
DISALLOW_COPY_AND_ASSIGN(SourceStreamSet);
};
+// A SinkStreamSet is a set of SinkStreams. Data is collected by writing to the
+// component streams. When data collection is complete, it is destructively
+// transferred, either by flattening into one stream (CopyTo), or transfering
+// data pairwise into another SinkStreamSet by calling that SinkStreamSet's
+// WriteSet method.
class SinkStreamSet {
public:
SinkStreamSet();
@@ -199,8 +207,8 @@
// Returns a pointer to a substream.
SinkStream* stream(size_t id) { return id < count_ ? &streams_[id] : NULL; }
- // CopyTo serializes the streams in the SinkStreamSet into a single target
- // stream or file. The serialized format may be re-read by initializing a
+ // CopyTo serializes the streams in this SinkStreamSet into a single target
+ // stream. The serialized format may be re-read by initializing a
// SourceStreamSet with a buffer containing the data.
bool CopyTo(SinkStream* combined_stream);
« no previous file with comments | « courgette/ensemble_create.cc ('k') | courgette/streams.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698