libalpm
Arch Linux Package Manager Library
pkghash.c File Reference
#include <errno.h>
#include "pkghash.h"
#include "util.h"
Include dependency graph for pkghash.c:

Functions

static unsigned int get_hash_position (unsigned long name_hash, alpm_pkghash_t *hash)
 
static alpm_pkghash_t * rehash (alpm_pkghash_t *oldhash)
 
static alpm_pkghash_t * pkghash_add_pkg (alpm_pkghash_t **hashref, alpm_pkg_t *pkg, int sorted)
 
static unsigned int move_one_entry (alpm_pkghash_t *hash, unsigned int start, unsigned int end)
 

Variables

static const unsigned int prime_list []
 
static const unsigned int stride = 1
 
static const double max_hash_load = 0.68
 
static const double initial_hash_load = 0.58
 

Function Documentation

◆ get_hash_position()

static unsigned int get_hash_position ( unsigned long name_hash,
alpm_pkghash_t * hash )
static

References stride.

Referenced by move_one_entry(), pkghash_add_pkg(), and rehash().

◆ move_one_entry()

static unsigned int move_one_entry ( alpm_pkghash_t * hash,
unsigned int start,
unsigned int end )
static

◆ pkghash_add_pkg()

static alpm_pkghash_t * pkghash_add_pkg ( alpm_pkghash_t ** hashref,
alpm_pkg_t * pkg,
int sorted )
static

◆ rehash()

static alpm_pkghash_t * rehash ( alpm_pkghash_t * oldhash)
static

References get_hash_position().

Referenced by pkghash_add_pkg().

Variable Documentation

◆ initial_hash_load

const double initial_hash_load = 0.58
static

◆ max_hash_load

const double max_hash_load = 0.68
static

◆ prime_list

const unsigned int prime_list[]
static
Initial value:
=
{
11u, 13u, 17u, 19u, 23u, 29u, 31u, 37u, 41u, 43u, 47u,
53u, 59u, 61u, 67u, 71u, 73u, 79u, 83u, 89u, 97u, 103u,
109u, 113u, 127u, 137u, 139u, 149u, 157u, 167u, 179u, 193u,
199u, 211u, 227u, 241u, 257u, 277u, 293u, 313u, 337u, 359u,
383u, 409u, 439u, 467u, 503u, 541u, 577u, 619u, 661u, 709u,
761u, 823u, 887u, 953u, 1031u, 1109u, 1193u, 1289u, 1381u,
1493u, 1613u, 1741u, 1879u, 2029u, 2179u, 2357u, 2549u,
2753u, 2971u, 3209u, 3469u, 3739u, 4027u, 4349u, 4703u,
5087u, 5503u, 5953u, 6427u, 6949u, 7517u, 8123u, 8783u,
9497u, 10273u, 11113u, 12011u, 12983u, 14033u, 15173u,
16411u, 17749u, 19183u, 20753u, 22447u, 24281u, 26267u,
28411u, 30727u, 33223u, 35933u, 38873u, 42043u, 45481u,
49201u, 53201u, 57557u, 62233u, 67307u, 72817u, 78779u,
85229u, 92203u, 99733u, 107897u, 116731u, 126271u, 136607u,
147793u, 159871u, 172933u, 187091u, 202409u, 218971u, 236897u,
256279u, 277261u, 299951u, 324503u, 351061u, 379787u, 410857u,
444487u, 480881u, 520241u, 562841u, 608903u, 658753u, 712697u,
771049u, 834181u, 902483u, 976369u
}

◆ stride

const unsigned int stride = 1
static