summaryrefslogtreecommitdiff
path: root/lib/fprint.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-09-08 11:25:16 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-09-08 11:25:16 +0300
commit7dc5ca2da158102f2ea16086520f440c158e6b60 (patch)
treef029afff3074cd91788fd05d89b0d96c6306b008 /lib/fprint.c
parent337a7b130a34b5f01863ff50fa92a7e3cf48b0a4 (diff)
downloadlibrpm-tizen-7dc5ca2da158102f2ea16086520f440c158e6b60.tar.gz
librpm-tizen-7dc5ca2da158102f2ea16086520f440c158e6b60.tar.bz2
librpm-tizen-7dc5ca2da158102f2ea16086520f440c158e6b60.zip
Switch file info set base- and dirnames storage to string pool
- Always push base and dir names into file info sets string pool, whether private or shared. For basenames, this can save significant space even in a private pool, for dirnames private pool is moot as the names are already unique, shared pool is quite another story. - Adjust fpLookupList() to take a pool and id's as arguments. - This introduces a fair amount of overhead, so things will be somewhat slower until the transition to pool id's is (more) complete. Sometimes things have to get worse before they get better... Other than that, this should be entirely invisible to callers.
Diffstat (limited to 'lib/fprint.c')
-rw-r--r--lib/fprint.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/fprint.c b/lib/fprint.c
index 261ad039b..ae37f8936 100644
--- a/lib/fprint.c
+++ b/lib/fprint.c
@@ -211,8 +211,9 @@ int fpEqual(const fingerPrint * k1, const fingerPrint * k2)
}
-void fpLookupList(fingerPrintCache cache, const char ** dirNames,
- const char ** baseNames, const uint32_t * dirIndexes,
+void fpLookupList(fingerPrintCache cache, rpmstrPool pool,
+ rpmsid * dirNames, rpmsid * baseNames,
+ const uint32_t * dirIndexes,
int fileCount, fingerPrint * fpList)
{
int i;
@@ -223,10 +224,12 @@ void fpLookupList(fingerPrintCache cache, const char ** dirNames,
if (i > 0 && dirIndexes[i - 1] == dirIndexes[i]) {
fpList[i].entry = fpList[i - 1].entry;
fpList[i].subDir = fpList[i - 1].subDir;
- fpList[i].baseName = baseNames[i];
+ fpList[i].baseName = rpmstrPoolStr(pool, baseNames[i]);
} else {
fpLookup(cache,
- dirNames[dirIndexes[i]], baseNames[i], 1, &fpList[i]);
+ rpmstrPoolStr(pool, dirNames[dirIndexes[i]]),
+ rpmstrPoolStr(pool, baseNames[i]),
+ 1, &fpList[i]);
}
}
}