diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-01 00:19:02 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-01 00:19:02 +0000 |
commit | fbd31eb81436cf7f6d4f9ea3683c100f112361e6 (patch) | |
tree | b0c191290d86ac3a70209fb0984320a88c1e3c07 /courgette/streams.h | |
parent | 4b764ded93509c0a58a1a8cca10b0964fdcca41d (diff) | |
download | chromium_src-fbd31eb81436cf7f6d4f9ea3683c100f112361e6.zip chromium_src-fbd31eb81436cf7f6d4f9ea3683c100f112361e6.tar.gz chromium_src-fbd31eb81436cf7f6d4f9ea3683c100f112361e6.tar.bz2 |
Implementation of an STL compatible allocator for Courgette on Windows.
This is to better handle low memory situations when applying a differential
patch to a large Chrome setup.
For reading input files, I'm also switching to using memory mapped files
instead of ReadFileToString to reduce the load on the heap.
TEST=courgette.exe should succeed in applying a patch between two
chrome 10.x archives on an XP machine with 180MB of physical memory and
no page file.
BUG=72459,73209
Review URL: http://codereview.chromium.org/6597038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76320 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'courgette/streams.h')
-rw-r--r-- | courgette/streams.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/courgette/streams.h b/courgette/streams.h index 3dbc2b7..7be28a5 100644 --- a/courgette/streams.h +++ b/courgette/streams.h @@ -18,6 +18,7 @@ #include "base/basictypes.h" +#include "courgette/memory_allocator.h" #include "courgette/region.h" namespace courgette { @@ -151,7 +152,11 @@ class SinkStream { void Retire(); private: - std::string buffer_; // Use a string to manage the stream's memory. + // Use a string to manage the stream's memory. + typedef std::basic_string<char, + std::char_traits<char>, + MemoryAllocator<char> > SinkBuffer; + SinkBuffer buffer_; DISALLOW_COPY_AND_ASSIGN(SinkStream); }; |