[go: nahoru, domu]

Switch out use of std::string and std::vector for large allocations for a buffer class that doesn't throw exceptions.
The new buffer class is pretty simple and relies on the MemoryAllocator class that I previously to back large
allocations with mapped files when memory is scarce.  That reduced the number of crashes quite a bit but we
still crash on machines that are simply out of diskspace as well.  So, the right thing to do is to expect and
handle failures which is what this cl is all about.  What we should see once this has landed is that crash
dumps due to courgette running out of disk space should disappear from crash/ and instead we should see the
number of users that run into this particular problem in dashboards.

TEST=Courgette out-of-memory/out-of-diskspace errors should disappear from crash/
BUG=74777
Review URL: http://codereview.chromium.org/6677141

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80648 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/courgette/adjustment_method_2.cc b/courgette/adjustment_method_2.cc
index 4a3d1c15b..e4fd716 100644
--- a/courgette/adjustment_method_2.cc
+++ b/courgette/adjustment_method_2.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
@@ -1254,7 +1254,7 @@
     label_info_maker_.ResetDebugLabel();
     const InstructionVector& instructions = program->instructions();
     for (size_t i = 0;  i < instructions.size();  ++i) {
-      Instruction* instruction = instructions.at(i);
+      Instruction* instruction = instructions[i];
       if (Label* label = program->InstructionAbs32Label(instruction))
         ReferenceLabel(abs32, label, is_model);
       if (Label* label = program->InstructionRel32Label(instruction))