Use 32 as the min alignment when running under NACL.
[mono.git] / mono / utils / mono-value-hash.c
index 754a98d3523842ca039172939d32a5fc94382bb1..adae6f06cad706c00eb40512f3490e3519b09704 100644 (file)
@@ -77,53 +77,6 @@ struct _MonoValueHashTable {
        GDestroyNotify value_destroy_func, key_destroy_func;
 };
 
-static const guint prime_tbl[] = {
-       11, 19, 37, 73, 109, 163, 251, 367, 557, 823, 1237,
-       1861, 2777, 4177, 6247, 9371, 14057, 21089, 31627,
-       47431, 71143, 106721, 160073, 240101, 360163,
-       540217, 810343, 1215497, 1823231, 2734867, 4102283,
-       6153409, 9230113, 13845163
-};
-
-static gboolean
-test_prime (int x)
-{
-       if ((x & 1) != 0) {
-               int n;
-               for (n = 3; n< (int)sqrt (x); n += 2) {
-                       if ((x % n) == 0)
-                               return FALSE;
-               }
-               return TRUE;
-       }
-       // There is only one even prime - 2.
-       return (x == 2);
-}
-
-static int
-calc_prime (int x)
-{
-       int i;
-       
-       for (i = (x & (~1))-1; i< G_MAXINT32; i += 2) {
-               if (test_prime (i))
-                       return i;
-       }
-       return x;
-}
-
-guint
-g_spaced_primes_closest (guint x)
-{
-       int i;
-       
-       for (i = 0; i < G_N_ELEMENTS (prime_tbl); i++) {
-               if (x <= prime_tbl [i])
-                       return prime_tbl [i];
-       }
-       return calc_prime (x);
-}
-
 static void
 mono_value_hash_table_set_shift (MonoValueHashTable *hash_table, gint shift)
 {
@@ -262,7 +215,7 @@ mono_value_hash_table_insert_replace (MonoValueHashTable *hash, gpointer key, gp
        Slot *s;
        guint s_index;
        GEqualFunc equal;
-       guint first_tombstone;
+       guint first_tombstone = 0;
        gboolean have_tombstone = FALSE;
        guint step = 0;