X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=isl_hash.c;h=7b96c51cd2f8e4fdfe9e68c500ed316013269f7c;hb=9f614eb1fb63dec83cf73c787f796c6a634f9fce;hp=c997402f2eb4136eff17330fc10ab5055b9fad1f;hpb=b7d848b49611b6bed2bfb1c7ab329beb54eca31d;p=platform%2Fupstream%2Fisl.git diff --git a/isl_hash.c b/isl_hash.c index c997402..7b96c51 100644 --- a/isl_hash.c +++ b/isl_hash.c @@ -1,7 +1,7 @@ /* * Copyright 2008-2009 Katholieke Universiteit Leuven * - * Use of this software is governed by the GNU LGPLv2.1 license + * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, K.U.Leuven, Departement * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium @@ -64,6 +64,7 @@ int isl_hash_table_init(struct isl_ctx *ctx, struct isl_hash_table *table, static int grow_table(struct isl_ctx *ctx, struct isl_hash_table *table, int (*eq)(const void *entry, const void *val)) { + int n; size_t old_size, size; struct isl_hash_table_entry *entries; uint32_t h; @@ -78,6 +79,8 @@ static int grow_table(struct isl_ctx *ctx, struct isl_hash_table *table, return -1; } + n = table->n; + table->n = 0; table->bits++; for (h = 0; h < old_size; ++h) { @@ -92,6 +95,7 @@ static int grow_table(struct isl_ctx *ctx, struct isl_hash_table *table, table->bits--; free(table->entries); table->entries = entries; + table->n = n; return -1; }