Queue lookat;
Queue lookat_dir;
- Hashval *cflmap;
- Hashmask cflmapn;
+ Hashtable cflmap;
+ Hashval cflmapn;
unsigned int cflmapused;
- Hashval *dirmap;
- Hashmask dirmapn;
+ Hashtable dirmap;
+ Hashval dirmapn;
unsigned int dirmapused;
int dirconflicts;
#define FILESSPACE_BLOCK 255
-static Hashval *
-doublehash(Hashval *map, Hashmask *mapnp)
+static Hashtable
+growhash(Hashtable map, Hashval *mapnp)
{
- Hashmask mapn = *mapnp;
- Hashmask i, hx, qx, h, hh;
- Hashmask nn = (mapn + 1) * 2 - 1;
- Hashmask *m;
+ Hashval mapn = *mapnp;
+ Hashval i, hx, qx, h, hh;
+ Hashval nn = (mapn + 1) * 2 - 1;
+ Hashtable m;
m = solv_calloc(nn + 1, 2 * sizeof(Id));
for (i = 0; i <= mapn; i++)
finddirs_cb(void *cbdatav, const char *fn, int fmode, const char *md5)
{
struct cbdata *cbdata = cbdatav;
- Hashmask h, hh, hx, qx;
+ Hashval h, hh, hx, qx;
Hashval idx = cbdata->idx;
hx = strhash(fn);
cbdata->dirmap[2 * h + 1] = idx;
cbdata->dirmapused++;
if (cbdata->dirmapused * 2 > cbdata->dirmapn)
- cbdata->dirmap = doublehash(cbdata->dirmap, &cbdata->dirmapn);
+ cbdata->dirmap = growhash(cbdata->dirmap, &cbdata->dirmapn);
return;
}
if (cbdata->dirmap[2 * h + 1] == idx)
}
static inline int
-isindirmap(struct cbdata *cbdata, Hashmask hx)
+isindirmap(struct cbdata *cbdata, Hashval hx)
{
- Hashmask h, hh, qx;
+ Hashval h, hh, qx;
h = hx & cbdata->dirmapn;
hh = HASHCHAIN_START;
int isdir = S_ISDIR(fmode);
char *dp;
Hashval idx, qidx;
- Hashmask qx, h, hx, hh, dhx;
+ Hashval qx, h, hx, hh, dhx;
idx = cbdata->idx;
cbdata->cflmap[2 * h + 1] = (isdir ? ~idx : idx);
cbdata->cflmapused++;
if (cbdata->cflmapused * 2 > cbdata->cflmapn)
- cbdata->cflmap = doublehash(cbdata->cflmap, &cbdata->cflmapn);
+ cbdata->cflmap = growhash(cbdata->cflmap, &cbdata->cflmapn);
return;
}
qidx = cbdata->cflmap[2 * h + 1];
idxmapset++;
}
- POOL_DEBUG(SOLV_DEBUG_STATS, "dirmap size: %d used %d\n", cbdata.dirmapn + 1, cbdata.dirmapused);
+ POOL_DEBUG(SOLV_DEBUG_STATS, "dirmap size: %d, used %d\n", cbdata.dirmapn + 1, cbdata.dirmapused);
POOL_DEBUG(SOLV_DEBUG_STATS, "dirmap memory usage: %d K\n", (cbdata.dirmapn + 1) * 2 * (int)sizeof(Id) / 1024);
POOL_DEBUG(SOLV_DEBUG_STATS, "dirmap creation took %d ms\n", solv_timems(now));
POOL_DEBUG(SOLV_DEBUG_STATS, "dir conflicts found: %d, idxmap %d of %d\n", cbdata.dirconflicts, idxmapset, pkgs->count);
rpm_iterate_filelist(handle, RPM_ITERATE_FILELIST_NOGHOSTS, findfileconflicts_cb, &cbdata);
}
- POOL_DEBUG(SOLV_DEBUG_STATS, "filemap size: %d used %d\n", cbdata.cflmapn + 1, cbdata.cflmapused);
+ POOL_DEBUG(SOLV_DEBUG_STATS, "filemap size: %d, used %d\n", cbdata.cflmapn + 1, cbdata.cflmapused);
POOL_DEBUG(SOLV_DEBUG_STATS, "filemap memory usage: %d K\n", (cbdata.cflmapn + 1) * 2 * (int)sizeof(Id) / 1024);
POOL_DEBUG(SOLV_DEBUG_STATS, "filemap creation took %d ms\n", solv_timems(now));
}
static Hashtable
-joinhash_init(Repo *repo, Hashmask *hmp)
+joinhash_init(Repo *repo, Hashval *hmp)
{
- Hashmask hm = mkmask(repo->nsolvables);
+ Hashval hm = mkmask(repo->nsolvables);
Hashtable ht = solv_calloc(hm + 1, sizeof(*ht));
Hashval h, hh;
Solvable *s;
}
static Solvable *
-joinhash_lookup(Repo *repo, Hashtable ht, Hashmask hm, const char *fn)
+joinhash_lookup(Repo *repo, Hashtable ht, Hashval hm, const char *fn)
{
const char *p;
Id name, evr;
int lastdnlen = 0;
Solvable *s = 0;
Hashtable joinhash = 0;
- Hashmask joinhashmask = 0;
+ Hashval joinhashmask = 0;
data = repo_add_repodata(repo, flags);
enum state sbtab[NUMSTATES];
Solvable *solvable;
Hashtable joinhash;
- Hashmask joinhashmask;
+ Hashval joinhashmask;
};
static inline const char *
}
static Hashtable
-joinhash_init(Repo *repo, Hashmask *hmp)
+joinhash_init(Repo *repo, Hashval *hmp)
{
- Hashmask hm = mkmask(repo->nsolvables);
+ Hashval hm = mkmask(repo->nsolvables);
Hashtable ht = solv_calloc(hm + 1, sizeof(*ht));
Hashval h, hh;
Solvable *s;
}
static Solvable *
-joinhash_lookup(Repo *repo, Hashtable ht, Hashmask hm, const char *fn, const char *distepoch)
+joinhash_lookup(Repo *repo, Hashtable ht, Hashval hm, const char *fn, const char *distepoch)
{
Hashval h, hh;
const char *p, *vrstart, *vrend;
}
static Hashtable
-joinhash_init(Repo *repo, Hashmask *hmp)
+joinhash_init(Repo *repo, Hashval *hmp)
{
- Hashmask hm = mkmask(repo->nsolvables);
+ Hashval hm = mkmask(repo->nsolvables);
Hashtable ht = solv_calloc(hm + 1, sizeof(*ht));
Hashval h, hh;
Solvable *s;
}
static Solvable *
-joinhash_lookup(Repo *repo, Hashtable ht, Hashmask hm, Id name, Id evr, Id arch, Id start)
+joinhash_lookup(Repo *repo, Hashtable ht, Hashval hm, Id name, Id evr, Id arch, Id start)
{
Hashval h, hh;
Repodata *data = 0;
Id handle = 0;
Hashtable joinhash = 0;
- Hashmask joinhashm = 0;
+ Hashval joinhashm = 0;
int createdpkgs = 0;
if ((flags & (SUSETAGS_EXTEND|REPO_EXTEND_SOLVABLES)) != 0 && repo->nrepodata)
/* value of a hash */
typedef unsigned int Hashval;
-/* mask for hash, used as modulo operator to ensure 'wrapping' of hash
- values -> hash table */
-typedef unsigned int Hashmask;
/* inside the hash table, Ids are stored. Hash maps: string -> hash -> Id */
typedef Id *Hashtable;
*
* used for Hashtable 'modulo' operation
*/
-static inline Hashmask
+static inline Hashval
mkmask(unsigned int num)
{
num *= 2;
/* hash for rel unification */
Hashtable relhashtbl; /* hashtable: (name,evr,op)Hash -> Id */
- Hashmask relhashmask;
+ Hashval relhashmask;
Id *languagecache;
int languagecacheother;
Id
pool_rel2id(Pool *pool, Id name, Id evr, int flags, int create)
{
- Hashval h;
- unsigned int hh;
- Hashmask hashmask;
+ Hashval h, hh, hashmask;
int i;
Id id;
Hashtable hashtbl;
Offset lastoff; /* start of last array in idarraydata */
Hashtable lastidhash; /* hash to speed up repo_addid_dep */
- Hashmask lastidhash_mask;
+ Hashval lastidhash_mask;
int lastidhash_idarraysize;
int lastmarker;
Offset lastmarkerpos;
char *sp; /* pointer into string space */
Id *idmap; /* map of repo Ids to pool Ids */
Id id, type;
- unsigned int hashmask, h;
- int hh;
- Id *hashtbl;
+ Hashval hashmask, h, hh;
+ Hashtable hashtbl;
Id name, evr, did;
int relflags;
Reldep *ran;
Id
stringpool_strn2id(Stringpool *ss, const char *str, unsigned int len, int create)
{
- Hashval h;
- unsigned int hh;
- Hashmask hashmask, oldhashmask;
+ Hashval h, hh, hashmask, oldhashmask;
int i;
Id id;
Hashtable hashtbl;
Offset sstrings; /* size of used stringspace */
Hashtable stringhashtbl; /* hash table: (string ->) Hash -> Id */
- Hashmask stringhashmask; /* modulo value for hash table (size of table - 1) */
+ Hashval stringhashmask; /* modulo value for hash table (size of table - 1) */
};
void stringpool_init(Stringpool *ss, const char *strs[]);