summaryrefslogtreecommitdiff
path: root/lib/rpmds.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-09-12 16:47:43 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-09-12 19:17:20 +0300
commit06546854933d0d7682bffbdf11c50c1efde17045 (patch)
treeb20ade2fd5d4e73ac875aee9a2c45aed250381ed /lib/rpmds.c
parent86dbb8844807b077f27255cccc9c0714a0005d02 (diff)
downloadlibrpm-tizen-06546854933d0d7682bffbdf11c50c1efde17045.tar.gz
librpm-tizen-06546854933d0d7682bffbdf11c50c1efde17045.tar.bz2
librpm-tizen-06546854933d0d7682bffbdf11c50c1efde17045.zip
Allow keeping hash table around on pool freeze, adjust callers
- Pool id -> string always works with a frozen pool, but in some cases we'll need to go the other way, allow caller to specify whether string -> id lookups should be possible on frozen pool. - On glibc, realloc() to smaller size doesn't move the data but on other platforms (including valgrind) it can and does move, which would require a full rehash. For now, just leave all the data alone unless we're also freeing the hash, the memory savings isn't much for a global pool (which is where this matters)
Diffstat (limited to 'lib/rpmds.c')
-rw-r--r--lib/rpmds.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rpmds.c b/lib/rpmds.c
index dcf2c39ab..3b7a836f8 100644
--- a/lib/rpmds.c
+++ b/lib/rpmds.c
@@ -212,7 +212,7 @@ rpmds rpmdsNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, int flags)
/* freeze the pool to save memory, but only if private pool */
if (ds->pool != pool)
- rpmstrPoolFreeze(ds->pool);
+ rpmstrPoolFreeze(ds->pool, 0);
}
exit:
@@ -310,7 +310,7 @@ static rpmds singleDS(rpmTagVal tagN, const char * N, const char * EVR,
/* freeze the pool on success to save memory */
if (ds != NULL)
- rpmstrPoolFreeze(ds->pool);
+ rpmstrPoolFreeze(ds->pool, 0);
/* free or unlink: ds now owns the reference */
rpmstrPoolFree(pool);
@@ -989,7 +989,7 @@ int rpmdsRpmlib(rpmds * dsp, const void * tblp)
rpmdsFree(ds);
}
if (*dsp)
- rpmstrPoolFreeze((*dsp)->pool);
+ rpmstrPoolFreeze((*dsp)->pool, 0);
return rc;
}