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

Unified Diff: courgette/ensemble_apply.cc

Issue 6716006: Identifying call sites that need to handle out of memory situations in Courgette. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 9 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
Index: courgette/ensemble_apply.cc
===================================================================
--- courgette/ensemble_apply.cc (revision 78901)
+++ courgette/ensemble_apply.cc (working copy)
@@ -220,10 +220,14 @@
SinkStream* basic_elements) {
// Construct blob of original input followed by reformed elements.
- basic_elements->Reserve(final_patch_input_size_prediction_);
+ if (final_patch_input_size_prediction_ &&
robertshield 2011/03/22 18:04:07 Even though this looks right, this is a functional
tommi (sloooow) - chröme 2011/03/22 18:37:49 Removed the first check to maintain the previous f
+ !basic_elements->Reserve(final_patch_input_size_prediction_)) {
+ return C_STREAM_ERROR;
+ }
// The original input:
- basic_elements->Write(base_region_.start(), base_region_.length());
+ if (!basic_elements->Write(base_region_.start(), base_region_.length()))
+ return C_STREAM_ERROR;
for (size_t i = 0; i < patchers_.size(); ++i) {
SourceStreamSet single_corrected_element;

Powered by Google App Engine
This is Rietveld 408576698