From 175fa7701ded3785c31e82581f74e2fd32db7330 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 15 Aug 2001 09:29:26 +0000 Subject: 2001-08-15 Roland McGrath * sizes.c: New file, a list of prime numbers useful for table sizes. * priv.h (_ihash_sizes, _ihash_nsizes): Declare. (_ihash_nextprime): Don't. * ihash.c (ihash_add): Select sizes from the _ihash_sizes array instead of using _ihash_nextprime. * Makefile: Clean up whitespace, reorder all the variable definitions. (SRCS): Remove primes.c, add sizes.c instead. (OBJS): Define dynamically. --- libihash/sizes.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 libihash/sizes.c (limited to 'libihash/sizes.c') diff --git a/libihash/sizes.c b/libihash/sizes.c new file mode 100644 index 00000000..17f3fb1f --- /dev/null +++ b/libihash/sizes.c @@ -0,0 +1,41 @@ +/* Some prime numbers for the ihash library. + I cannot bring myself to assert copyright over a list of prime numbers. + This file is in the public domain. */ + +#include "priv.h" + +/* The prime numbers greater than twice the last and less than 2^32. */ +const unsigned int _ihash_sizes[] = +{ + 2, + 5, + 11, + 23, + 47, + 97, + 197, + 397, + 797, + 1597, + 3203, + 6421, + 12853, + 25717, + 51437, + 102877, + 205759, + 411527, + 823117, + 1646237, + 3292489, + 6584983, + 13169977, + 26339969, + 52679969, + 105359939, + 210719881, + 421439783, +}; + +const unsigned int _ihash_nsizes = (sizeof _ihash_sizes + / sizeof _ihash_sizes[0]); -- cgit v1.2.3