X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_hashtable.c;h=4d0521574b61c20d5bd26445ba06c33ef48e5adb;hb=5641fc7c3abf79756d28a28da8c15b4addf26fe5;hp=00e6f5269927221f0dc6e57a9f157844125bf9a2;hpb=513222398724762540dea9cbe9aea6e1578c80ac;p=palacios.git diff --git a/palacios/src/palacios/vmm_hashtable.c b/palacios/src/palacios/vmm_hashtable.c index 00e6f52..4d05215 100644 --- a/palacios/src/palacios/vmm_hashtable.c +++ b/palacios/src/palacios/vmm_hashtable.c @@ -197,7 +197,7 @@ static const uint_t load_factors[] = { 32715575, 65431158, 130862298, 261724573, 523449198, 1046898282 }; -const uint_t prime_table_length = sizeof(primes) / sizeof(primes[0]); +static const uint_t prime_table_length = sizeof(primes) / sizeof(primes[0]); @@ -222,6 +222,10 @@ struct hashtable * v3_create_htable(uint_t min_size, } } + if (prime_index==prime_table_length) { + return NULL; + } + htable = (struct hashtable *)V3_Malloc(sizeof(struct hashtable)); if (htable == NULL) { @@ -733,6 +737,11 @@ int v3_htable_iter_search(struct hashtable_iter * iter, return 0; } +void v3_destroy_htable_iter(struct hashtable_iter * iter) { + if (iter) { + V3_Free(iter); + } +}