Chromium Code Reviews

Unified Diff: courgette/ensemble_create.cc

Issue 6602017: Merge 75787 - Improved memory usage while applying patch.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/648/src/
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « courgette/ensemble_apply.cc ('k') | courgette/streams.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/ensemble_create.cc
===================================================================
--- courgette/ensemble_create.cc (revision 76288)
+++ courgette/ensemble_create.cc (working copy)
@@ -351,6 +351,9 @@
if (delta2_status != C_OK)
return delta2_status;
+ // Last use, free storage.
+ linearized_predicted_transformed_elements.Retire();
+
//
// Generate sub-patch for whole enchilada.
//
@@ -381,8 +384,12 @@
if (!corrected_transformed_elements_source_set.Empty())
return C_STREAM_NOT_CONSUMED;
+ // No more references to this stream's buffer.
+ linearized_corrected_transformed_elements.Retire();
+
FreeGenerators(&generators);
+ size_t final_patch_input_size = predicted_ensemble.Length();
SourceStream predicted_ensemble_source;
predicted_ensemble_source.Init(predicted_ensemble);
Status delta3_status = GenerateSimpleDelta(&predicted_ensemble_source,
@@ -401,6 +408,7 @@
CalculateCrc(old_region.start(), old_region.length()));
final_patch->WriteVarint32(
CalculateCrc(new_region.start(), new_region.length()));
+ final_patch->WriteSizeVarint32(final_patch_input_size);
if (!patch_streams.CopyTo(final_patch))
return C_STREAM_ERROR;
« no previous file with comments | « courgette/ensemble_apply.cc ('k') | courgette/streams.h » ('j') | no next file with comments »

Powered by Google App Engine