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

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
« no previous file with comments | « courgette/encoded_program_unittest.cc ('k') | courgette/memory_allocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/ensemble_apply.cc
===================================================================
--- courgette/ensemble_apply.cc (revision 78901)
+++ courgette/ensemble_apply.cc (working copy)
@@ -220,10 +220,13 @@
SinkStream* basic_elements) {
// Construct blob of original input followed by reformed elements.
- basic_elements->Reserve(final_patch_input_size_prediction_);
+ if (!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;
« no previous file with comments | « courgette/encoded_program_unittest.cc ('k') | courgette/memory_allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698