forked from github/server
Alle Hashfunktionen mit Primzahlen, evtl. bessere Performance.
This commit is contained in:
parent
6298a3a165
commit
5296949c1b
|
@ -104,7 +104,7 @@ typedef struct translation {
|
||||||
const char * value;
|
const char * value;
|
||||||
} translation;
|
} translation;
|
||||||
|
|
||||||
#define TRANSMAXHASH 255
|
#define TRANSMAXHASH 257
|
||||||
static translation * translation_table[TRANSMAXHASH];
|
static translation * translation_table[TRANSMAXHASH];
|
||||||
static translation * junkyard;
|
static translation * junkyard;
|
||||||
|
|
||||||
|
@ -421,7 +421,7 @@ creport_cleanup(void)
|
||||||
|
|
||||||
/*static int msgno; */
|
/*static int msgno; */
|
||||||
|
|
||||||
#define MTMAXHASH 1023
|
#define MTMAXHASH 1021
|
||||||
|
|
||||||
static struct known_mtype {
|
static struct known_mtype {
|
||||||
const struct message_type * mtype;
|
const struct message_type * mtype;
|
||||||
|
|
|
@ -2594,7 +2594,7 @@ prepare_report(faction * f)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#define FMAXHASH 1023
|
#define FMAXHASH 1021
|
||||||
|
|
||||||
struct fsee {
|
struct fsee {
|
||||||
struct fsee * nexthash;
|
struct fsee * nexthash;
|
||||||
|
|
|
@ -137,7 +137,7 @@ buildingmaintenance(const building * b, const resource_type * rtype)
|
||||||
return cost;
|
return cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define BMAXHASH 8191
|
#define BMAXHASH 7919
|
||||||
static building *buildhash[BMAXHASH];
|
static building *buildhash[BMAXHASH];
|
||||||
void
|
void
|
||||||
bhash(building * b)
|
bhash(building * b)
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
|
||||||
#define MAXENTITYHASH 8191
|
#define MAXENTITYHASH 7919
|
||||||
curse *cursehash[MAXENTITYHASH];
|
curse *cursehash[MAXENTITYHASH];
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -562,7 +562,7 @@ ufindhash (int i)
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define FMAXHASH 2047
|
#define FMAXHASH 2039
|
||||||
faction * factionhash[FMAXHASH];
|
faction * factionhash[FMAXHASH];
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define GMAXHASH 2047
|
#define GMAXHASH 2039
|
||||||
static group * ghash[GMAXHASH];
|
static group * ghash[GMAXHASH];
|
||||||
static int maxgid;
|
static int maxgid;
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#define PMAXHASH 1023
|
#define PMAXHASH 1021
|
||||||
|
|
||||||
typedef struct player_hash {
|
typedef struct player_hash {
|
||||||
struct player * entries;
|
struct player * entries;
|
||||||
|
|
|
@ -257,7 +257,7 @@ attrib_type at_moveblock = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define RMAXHASH 65535
|
#define RMAXHASH 65521
|
||||||
region *regionhash[RMAXHASH];
|
region *regionhash[RMAXHASH];
|
||||||
|
|
||||||
static region *
|
static region *
|
||||||
|
|
|
@ -907,7 +907,7 @@ get_addresses(faction * f)
|
||||||
}
|
}
|
||||||
|
|
||||||
seen_region * reuse;
|
seen_region * reuse;
|
||||||
#define MAXSEEHASH 4095
|
#define MAXSEEHASH 4999
|
||||||
seen_region * seehash[MAXSEEHASH];
|
seen_region * seehash[MAXSEEHASH];
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -158,7 +158,7 @@ typedef struct uniquenode {
|
||||||
faction * f;
|
faction * f;
|
||||||
} uniquenode;
|
} uniquenode;
|
||||||
|
|
||||||
#define HASHSIZE 2047
|
#define HASHSIZE 2039
|
||||||
static uniquenode * uniquehash[HASHSIZE];
|
static uniquenode * uniquehash[HASHSIZE];
|
||||||
|
|
||||||
static faction *
|
static faction *
|
||||||
|
|
|
@ -84,7 +84,7 @@ st_register(const ship_type * type) {
|
||||||
shiptypes = stl;
|
shiptypes = stl;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SMAXHASH 8191
|
#define SMAXHASH 7919
|
||||||
ship *shiphash[SMAXHASH];
|
ship *shiphash[SMAXHASH];
|
||||||
void
|
void
|
||||||
shash(ship * s)
|
shash(ship * s)
|
||||||
|
|
|
@ -74,7 +74,7 @@ u_unknown(void)
|
||||||
return &unknown;
|
return &unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DMAXHASH 8191
|
#define DMAXHASH 7919
|
||||||
typedef struct dead {
|
typedef struct dead {
|
||||||
struct dead * nexthash;
|
struct dead * nexthash;
|
||||||
faction * f;
|
faction * f;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define MAXATHASH 63
|
#define MAXATHASH 61
|
||||||
attrib_type * at_hash[MAXATHASH];
|
attrib_type * at_hash[MAXATHASH];
|
||||||
|
|
||||||
static unsigned int
|
static unsigned int
|
||||||
|
|
|
@ -126,7 +126,7 @@ typedef struct messagetype_list {
|
||||||
const struct message_type * data;
|
const struct message_type * data;
|
||||||
} messagetype_list;
|
} messagetype_list;
|
||||||
|
|
||||||
#define MT_MAXHASH 1023
|
#define MT_MAXHASH 1021
|
||||||
static messagetype_list * messagetypes[MT_MAXHASH];
|
static messagetype_list * messagetypes[MT_MAXHASH];
|
||||||
|
|
||||||
const message_type *
|
const message_type *
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define NRT_MAXHASH 1023
|
#define NRT_MAXHASH 1021
|
||||||
static nrmessage_type * messagetypes[NRT_MAXHASH];
|
static nrmessage_type * messagetypes[NRT_MAXHASH];
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
|
Loading…
Reference in New Issue