diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-24 17:08:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-24 17:08:55 +0400 |
commit | f2acb10b6b160b9ab85591d4717e27be800a0568 (patch) | |
tree | 367c137cfb82c88e2fbe5ab3e4ae23d0ea18731d /source/blender/blenlib | |
parent | 9c090cecfe21ef357031373b0711a2bc57ee5176 (diff) |
edge hash: take an arg for the guarded-malloc string (as ghash does)
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_edgehash.h | 5 | ||||
-rw-r--r-- | source/blender/blenlib/intern/edgehash.c | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/blenlib/BLI_edgehash.h b/source/blender/blenlib/BLI_edgehash.h index f961d73cd79..80eac9199e3 100644 --- a/source/blender/blenlib/BLI_edgehash.h +++ b/source/blender/blenlib/BLI_edgehash.h @@ -40,8 +40,9 @@ enum { EDGEHASH_FLAG_ALLOW_DUPES = (1 << 0), /* only checked for in debug mode */ }; -EdgeHash *BLI_edgehash_new_ex(const unsigned int nentries_reserve); -EdgeHash *BLI_edgehash_new(void); +EdgeHash *BLI_edgehash_new_ex(const char *info, + const unsigned int nentries_reserve); +EdgeHash *BLI_edgehash_new(const char *info); void BLI_edgehash_free(EdgeHash *eh, EdgeHashFreeFP valfreefp); void BLI_edgehash_insert(EdgeHash *eh, unsigned int v0, unsigned int v1, void *val); void BLI_edgehash_assign(EdgeHash *eh, unsigned int v0, unsigned int v1, void *val); diff --git a/source/blender/blenlib/intern/edgehash.c b/source/blender/blenlib/intern/edgehash.c index 738f1f0c7a1..25db659b3d4 100644 --- a/source/blender/blenlib/intern/edgehash.c +++ b/source/blender/blenlib/intern/edgehash.c @@ -162,9 +162,10 @@ static void edgehash_insert_ex(EdgeHash *eh, unsigned int v0, unsigned int v1, v /* Public API */ -EdgeHash *BLI_edgehash_new_ex(const unsigned int nentries_reserve) +EdgeHash *BLI_edgehash_new_ex(const char *info, + const unsigned int nentries_reserve) { - EdgeHash *eh = MEM_callocN(sizeof(*eh), "EdgeHash"); + EdgeHash *eh = MEM_mallocN(sizeof(*eh), info); eh->nbuckets = _ehash_hashsizes[0]; /* eh->cursize */ eh->nentries = 0; @@ -184,9 +185,9 @@ EdgeHash *BLI_edgehash_new_ex(const unsigned int nentries_reserve) return eh; } -EdgeHash *BLI_edgehash_new(void) +EdgeHash *BLI_edgehash_new(const char *info) { - return BLI_edgehash_new_ex(0); + return BLI_edgehash_new_ex(info, 0); } /** |