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
diff --git a/courgette/adjustment_method_2.cc b/courgette/adjustment_method_2.cc
index cacf33e..e3ca3152 100644
--- a/courgette/adjustment_method_2.cc
+++ b/courgette/adjustment_method_2.cc
@@ -1252,7 +1252,7 @@
void CollectTraces(const AssemblyProgram* program, Trace* abs32, Trace* rel32,
bool is_model) {
label_info_maker_.ResetDebugLabel();
- const std::vector<Instruction*>& instructions = program->instructions();
+ const InstructionVector& instructions = program->instructions();
for (size_t i = 0; i < instructions.size(); ++i) {
Instruction* instruction = instructions.at(i);
if (Label* label = program->InstructionAbs32Label(instruction))