Add a string pool to fingerprint cache (but not yet used)
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 14 Sep 2012 07:01:54 +0000 (10:01 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 14 Sep 2012 10:45:05 +0000 (13:45 +0300)
lib/fprint.c

index 916e66a..e7dd4ad 100644 (file)
@@ -79,6 +79,7 @@ struct fingerPrint_s {
 struct fprintCache_s {
     rpmFpEntryHash ht;                 /*!< hashed by dirName */
     rpmFpHash fp;                      /*!< hashed by fingerprint */
+    rpmstrPool pool;                   /*!< string pool */
 };
 
 fingerPrintCache fpCacheCreate(int sizeHint)
@@ -89,6 +90,7 @@ fingerPrintCache fpCacheCreate(int sizeHint)
     fpc->ht = rpmFpEntryHashCreate(sizeHint, rstrhash, strcmp,
                                   (rpmFpEntryHashFreeKey)free,
                                   (rpmFpEntryHashFreeData)free);
+    fpc->pool = rpmstrPoolCreate();
     return fpc;
 }
 
@@ -97,6 +99,7 @@ fingerPrintCache fpCacheFree(fingerPrintCache cache)
     if (cache) {
        cache->ht = rpmFpEntryHashFree(cache->ht);
        cache->fp = rpmFpHashFree(cache->fp);
+       cache->pool = rpmstrPoolFree(cache->pool);
        free(cache);
     }
     return NULL;