if (fi != NULL && ix >= 0 && ix < fi->fc) {
if (fi->flinks != NULL)
- flink = strcacheGet(fi->flinkcache, fi->flinks[ix]);
+ flink = rpmstrPoolStr(fi->pool, fi->flinks[ix]);
}
return flink;
}
fi->bnl = _free(fi->bnl);
fi->dnl = _free(fi->dnl);
- fi->flinkcache = strcacheFree(fi->flinkcache);
fi->flinks = _free(fi->flinks);
fi->flangs = _free(fi->flangs);
fi->digests = _free(fi->digests);
fi->fstates = _free(fi->fstates);
fi->fps = _free(fi->fps);
+ fi->pool = rpmstrPoolFree(fi->pool);
+
/* these point to header memory if KEEPHEADER is used, dont free */
if (!(fi->fiflags & RPMFI_KEEPHEADER) && fi->h == NULL) {
fi->fmtimes = _free(fi->fmtimes);
/* XXX: ensure the global misc. pool exists */
if (miscpool == NULL)
miscpool = rpmstrPoolCreate();
+ fi->pool = rpmstrPoolCreate();
/* XXX TODO: all these should be sanity checked, ugh... */
if (!(flags & RPMFI_NOFILEMODES))
if (!(flags & RPMFI_NOFILECAPS))
_hgfi(h, RPMTAG_FILECAPS, &td, defFlags, fi->fcaps);
- if (!(flags & RPMFI_NOFILELINKTOS)) {
- fi->flinkcache = strcacheNew();
- fi->flinks = cacheTag(fi->flinkcache, h, RPMTAG_FILELINKTOS);
- }
+ if (!(flags & RPMFI_NOFILELINKTOS))
+ fi->flinks = tag2pool(fi->pool, h, RPMTAG_FILELINKTOS);
/* FILELANGS are only interesting when installing */
if ((headerGetInstance(h) == 0) && !(flags & RPMFI_NOFILELANGS))
fi->flangs = tag2pool(miscpool, h, RPMTAG_FILELANGS);
/* lazily alloced from rpmfiFN() */
fi->fn = NULL;
+ rpmstrPoolFreeze(fi->pool);
+
exit:
if (fi != NULL) {
int j; /*!< Current directory index. */
Header h; /*!< Header for file info set (or NULL) */
+ rpmstrPool pool; /*!< String pool of this file info set */
const char ** bnl; /*!< Base name(s) (from header) */
const char ** dnl; /*!< Directory name(s) (from header) */
- strcache flinkcache; /*!< File link cache */
- scidx_t * flinks; /*!< Index to file link(s) cache */
+ rpmsid * flinks; /*!< Index to file link(s) (pool) */
uint32_t * dil; /*!< Directory indice(s) (from header) */
rpm_flag_t * fflags; /*!< File flag(s) (from header) */