BLI_GHash: add BLI_gset_str_new helpers.

This commit is contained in:
Bastien Montagne 2015-07-02 20:35:05 +02:00
parent 626a287c89
commit 2b5e150db0
Notes: blender-bot 2023-02-14 08:53:18 +01:00
Referenced by issue #45537, cycles bake crashes with motionblur on
Referenced by issue #45463, Cycles bake - high-> lowpoly bake triangle orientation is mixed for texture coords in shader normals.
2 changed files with 13 additions and 4 deletions

View File

@ -234,11 +234,11 @@ void BLI_gset_clear_ex(GSet *gs, GSetKeyFreeFP keyfreefp,
const unsigned int nentries_reserve);
void BLI_gset_clear(GSet *gs, GSetKeyFreeFP keyfreefp);
GSet *BLI_gset_ptr_new_ex(const char *info,
const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
GSet *BLI_gset_ptr_new_ex(const char *info, const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
GSet *BLI_gset_ptr_new(const char *info);
GSet *BLI_gset_pair_new_ex(const char *info,
const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
GSet *BLI_gset_str_new_ex(const char *info, const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
GSet *BLI_gset_str_new(const char *info);
GSet *BLI_gset_pair_new_ex(const char *info, const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
GSet *BLI_gset_pair_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
/* rely on inline api for now */

View File

@ -1356,6 +1356,15 @@ GSet *BLI_gset_ptr_new(const char *info)
return BLI_gset_ptr_new_ex(info, 0);
}
GSet *BLI_gset_str_new_ex(const char *info, const unsigned int nentries_reserve)
{
return BLI_gset_new_ex(BLI_ghashutil_strhash_p, BLI_ghashutil_strcmp, info, nentries_reserve);
}
GSet *BLI_gset_str_new(const char *info)
{
return BLI_gset_str_new_ex(info, 0);
}
GSet *BLI_gset_pair_new_ex(const char *info, const unsigned int nentries_reserve)
{
return BLI_gset_new_ex(BLI_ghashutil_pairhash, BLI_ghashutil_paircmp, info, nentries_reserve);