Freeze the rpmfc string pools once all additions are done
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 26 Sep 2012 09:52:13 +0000 (12:52 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 26 Sep 2012 09:52:13 +0000 (12:52 +0300)
- Memory use isn't typically that critical during build, but saving
  a little bit of it doesn't hurt anyway...

build/rpmfc.c

index 7de2da1..990abab 100644 (file)
@@ -816,6 +816,8 @@ rpmRC rpmfcApply(rpmfc fc)
            rpmfcHelperRequires(fc, *fattr);
        }
     }
+    /* No more additions after this, freeze pool to minimize memory use */
+    rpmstrPoolFreeze(fc->ddict, 0);
 
     /* Generate per-file indices into package dependencies. */
     nddict = rpmstrPoolNumStr(fc->ddict);
@@ -1019,6 +1021,8 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode)
     rc = RPMRC_OK;
 
 exit:
+    /* No more additions after this, freeze pool to minimize memory use */
+    rpmstrPoolFreeze(fc->cdict, 0);
     if (ms != NULL)
        magic_close(ms);