diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-22 00:21:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-22 00:21:42 +0400 |
commit | 4dd9353e563ebe56fce0835d7a63ffb6454f73ab (patch) | |
tree | 23c756ddacac7ab741dafb4c3dfdb8adf926b069 /source/blender/blenlib/intern/BLI_ghash.c | |
parent | a31db0c7e929c480b3413f0688d7ec02203b3267 (diff) |
ghash/edgehash flag wasn't being initialized for new hashes. also init vars in same order for ghash/edgehash.
Diffstat (limited to 'source/blender/blenlib/intern/BLI_ghash.c')
-rw-r--r-- | source/blender/blenlib/intern/BLI_ghash.c | 8 |
1 files changed, 5 insertions, 3 deletions
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; } |