Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-08-24 19:14:50 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-08-24 19:14:50 +0400
commit4b1fc0593ec790b30c211a2d8edbbc47577f6c76 (patch)
treed78d2677588219e9989420da2ef790dccfab2e3b /source/blender/blenlib/intern/BLI_ghash.c
parentaefe93d909fc41c739d47a7e6a71f0f7d72a5479 (diff)
add versions of BLI_ghash_int_new, BLI_ghash_str_new, etc. that take a reserve argument.
Diffstat (limited to 'source/blender/blenlib/intern/BLI_ghash.c')
-rw-r--r--source/blender/blenlib/intern/BLI_ghash.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c
index 06a1347a327..edb29fa6d3e 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -467,21 +467,48 @@ int BLI_ghashutil_strcmp(const void *a, const void *b)
return strcmp(a, b);
}
+GHash *BLI_ghash_ptr_new_ex(const char *info,
+ const unsigned int nentries_reserve)
+{
+ return BLI_ghash_new_ex(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, info,
+ nentries_reserve);
+}
GHash *BLI_ghash_ptr_new(const char *info)
{
- return BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, info);
+ return BLI_ghash_ptr_new_ex(info, 0);
+}
+
+GHash *BLI_ghash_str_new_ex(const char *info,
+ const unsigned int nentries_reserve)
+{
+ return BLI_ghash_new_ex(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, info,
+ nentries_reserve);
}
GHash *BLI_ghash_str_new(const char *info)
{
- return BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, info);
+ return BLI_ghash_str_new_ex(info, 0);
+}
+
+GHash *BLI_ghash_int_new_ex(const char *info,
+ const unsigned int nentries_reserve)
+{
+ return BLI_ghash_new_ex(BLI_ghashutil_inthash, BLI_ghashutil_intcmp, info,
+ nentries_reserve);
}
GHash *BLI_ghash_int_new(const char *info)
{
- return BLI_ghash_new(BLI_ghashutil_inthash, BLI_ghashutil_intcmp, info);
+ return BLI_ghash_int_new_ex(info, 0);
+}
+
+GHash *BLI_ghash_pair_new_ex(const char *info,
+ const unsigned int nentries_reserve)
+{
+ return BLI_ghash_new_ex(BLI_ghashutil_pairhash, BLI_ghashutil_paircmp, info,
+ nentries_reserve);
}
GHash *BLI_ghash_pair_new(const char *info)
{
- return BLI_ghash_new(BLI_ghashutil_pairhash, BLI_ghashutil_paircmp, info);
+ return BLI_ghash_pair_new_ex(info, 0);
}
GHashPair *BLI_ghashutil_pairalloc(const void *first, const void *second)