rpmstrPool pool; /*!< string pool */
};
-fingerPrintCache fpCacheCreate(int sizeHint)
+fingerPrintCache fpCacheCreate(int sizeHint, rpmstrPool pool)
{
fingerPrintCache fpc;
fpc = xcalloc(1, sizeof(*fpc));
fpc->ht = rpmFpEntryHashCreate(sizeHint, sidHash, sidCmp,
NULL, (rpmFpEntryHashFreeData)free);
- fpc->pool = rpmstrPoolCreate();
+ fpc->pool = (pool != NULL) ? rpmstrPoolLink(pool) : rpmstrPoolCreate();
return fpc;
}
/**
* Create finger print cache.
* @param sizeHint number of elements expected
+ * @param pool string pool (or NULL for private)
* @return pointer to initialized fingerprint cache
*/
RPM_GNUC_INTERNAL
-fingerPrintCache fpCacheCreate(int sizeHint);
+fingerPrintCache fpCacheCreate(int sizeHint, rpmstrPool pool);
/**
* Destroy finger print cache.
if (rc || allMatches == NULL) goto exit;
*matches = xcalloc(1, sizeof(**matches));
- fpc = fpCacheCreate(allMatches->count);
+ fpc = fpCacheCreate(allMatches->count, NULL);
fpLookup(fpc, dirName, baseName, &fp1);
i = 0;
/* Required for now to lock string pointers in memory */
rpmstrPoolFreeze(tsmem->pool, 1);
- fingerPrintCache fpc = fpCacheCreate(fileCount/2 + 10001);
+ fingerPrintCache fpc = fpCacheCreate(fileCount/2 + 10001, NULL);
rpmlog(RPMLOG_DEBUG, "computing %" PRIu64 " file fingerprints\n", fileCount);