summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-repo-static-delta-compilation.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2016-09-08 10:47:33 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2016-09-08 15:21:41 +0000
commit23b4b58d57c7f9f01144a5e59daf26fbe6d5ba4d (patch)
tree625465e69fb1d85b0cbdfc025a24585e21985b71 /src/libostree/ostree-repo-static-delta-compilation.c
parente127070550fd22d129cd19b45e0d8c74c1b8cc79 (diff)
downloadostree-23b4b58d57c7f9f01144a5e59daf26fbe6d5ba4d.tar.gz
delta: Unreference files we've processed
This should help avoid address space exhaustion on 32 bit systems, and in general is obviously going to improve efficiency. Closes: #498 Approved by: alexlarsson
Diffstat (limited to 'src/libostree/ostree-repo-static-delta-compilation.c')
-rw-r--r--src/libostree/ostree-repo-static-delta-compilation.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/libostree/ostree-repo-static-delta-compilation.c b/src/libostree/ostree-repo-static-delta-compilation.c
index 15b1df8d..acface61 100644
--- a/src/libostree/ostree-repo-static-delta-compilation.c
+++ b/src/libostree/ostree-repo-static-delta-compilation.c
@@ -429,8 +429,8 @@ content_rollsums_free (ContentRollsum *rollsum)
{
g_free (rollsum->from_checksum);
_ostree_rollsum_matches_free (rollsum->matches);
- g_bytes_unref (rollsum->tmp_from);
- g_bytes_unref (rollsum->tmp_to);
+ g_clear_pointer (&rollsum->tmp_from, g_bytes_unref);
+ g_clear_pointer (&rollsum->tmp_to, g_bytes_unref);
g_free (rollsum);
}
@@ -438,8 +438,8 @@ static void
content_bsdiffs_free (ContentBsdiff *bsdiff)
{
g_free (bsdiff->from_checksum);
- g_bytes_unref (bsdiff->tmp_from);
- g_bytes_unref (bsdiff->tmp_to);
+ g_clear_pointer (&bsdiff->tmp_from, g_bytes_unref);
+ g_clear_pointer (&bsdiff->tmp_to, g_bytes_unref);
g_free (bsdiff);
}
@@ -758,6 +758,9 @@ process_one_rollsum (OstreeRepo *repo,
g_string_append_c (current_part->operations, (gchar)OSTREE_STATIC_DELTA_OP_CLOSE);
}
+ g_clear_pointer (&rollsum->tmp_from, g_bytes_unref);
+ g_clear_pointer (&rollsum->tmp_to, g_bytes_unref);
+
ret = TRUE;
out:
return ret;
@@ -854,6 +857,9 @@ process_one_bsdiff (OstreeRepo *repo,
g_string_append_c (current_part->operations, (gchar)OSTREE_STATIC_DELTA_OP_UNSET_READ_SOURCE);
+ g_clear_pointer (&bsdiff_content->tmp_from, g_bytes_unref);
+ g_clear_pointer (&bsdiff_content->tmp_to, g_bytes_unref);
+
ret = TRUE;
out:
return ret;