am 3a2e91ca: am 8765fca2: Merge "Free the stash after its use in BBOTA v2."

* commit '3a2e91cad7ec1309c07e9d96d572c6a0bed52346':
  Free the stash after its use in BBOTA v2.
This commit is contained in:
Tao Bao 2015-08-13 22:31:27 +00:00 committed by Android Git Automerger
commit 6968a724a5
1 changed files with 6 additions and 0 deletions

View File

@ -350,6 +350,12 @@ class BlockImageDiff(object):
mapped_stashes.append(sr) mapped_stashes.append(sr)
if self.version == 2: if self.version == 2:
src_str.append("%d:%s" % (sid, sr.to_string_raw())) src_str.append("%d:%s" % (sid, sr.to_string_raw()))
# A stash will be used only once. We need to free the stash
# immediately after the use, instead of waiting for the automatic
# clean-up at the end. Because otherwise it may take up extra space
# and lead to OTA failures.
# Bug: 23119955
free_string.append("free %d\n" % (sid,))
else: else:
assert sh in stashes assert sh in stashes
src_str.append("%s:%s" % (sh, sr.to_string_raw())) src_str.append("%s:%s" % (sh, sr.to_string_raw()))