From 4dd9353e563ebe56fce0835d7a63ffb6454f73ab Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 21 Aug 2013 20:21:42 +0000 Subject: ghash/edgehash flag wasn't being initialized for new hashes. also init vars in same order for ghash/edgehash. --- source/blender/blenlib/intern/BLI_ghash.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/blender/blenlib/intern/BLI_ghash.c') diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index 2a8dd795549..10a425ca12c 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -150,15 +150,17 @@ static void ghash_insert_ex(GHash *gh, void *key, void *val, GHash *BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) { GHash *gh = MEM_mallocN(sizeof(*gh), info); + gh->hashfp = hashfp; gh->cmpfp = cmpfp; - gh->entrypool = BLI_mempool_create(sizeof(Entry), 64, 64, 0); - gh->cursize = 0; + gh->nbuckets = hashsizes[0]; /* gh->cursize */ gh->nentries = 0; - gh->nbuckets = hashsizes[gh->cursize]; + gh->cursize = 0; + gh->flag = 0; gh->buckets = MEM_callocN(gh->nbuckets * sizeof(*gh->buckets), "buckets"); + gh->entrypool = BLI_mempool_create(sizeof(Entry), 64, 64, 0); return gh; } -- cgit v1.2.3