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:
authorJacques Lucke <jacques@blender.org>2020-07-20 17:00:20 +0300
committerJacques Lucke <jacques@blender.org>2020-07-20 17:03:14 +0300
commitccc2a7996b836cd255fbb7d7f693f5b958442043 (patch)
tree0ce38fb1d1d0980dc73fa6d8816f7f4e82ba46df /source/blender/blenlib/BLI_vector_set.hh
parented184050b6e787bbfb218e8ad2a0108172a1b68c (diff)
BLI: add typedefs for containers that use raw allocators
Those are useful when you have to create containers with static storage duration. If those would use Blender's guarded allocator, it would report memory leaks, that are not actually leaks.
Diffstat (limited to 'source/blender/blenlib/BLI_vector_set.hh')
-rw-r--r--source/blender/blenlib/BLI_vector_set.hh11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_vector_set.hh b/source/blender/blenlib/BLI_vector_set.hh
index 7573b77cdf7..f007d41118f 100644
--- a/source/blender/blenlib/BLI_vector_set.hh
+++ b/source/blender/blenlib/BLI_vector_set.hh
@@ -732,6 +732,17 @@ class VectorSet {
}
};
+/**
+ * Same as a normal VectorSet, but does not use Blender's guarded allocator. This is useful when
+ * allocating memory with static storage duration.
+ */
+template<typename Key,
+ typename ProbingStrategy = DefaultProbingStrategy,
+ typename Hash = DefaultHash<Key>,
+ typename IsEqual = DefaultEquality,
+ typename Slot = typename DefaultVectorSetSlot<Key>::type>
+using RawVectorSet = VectorSet<Key, ProbingStrategy, Hash, IsEqual, Slot, RawAllocator>;
+
} // namespace blender
#endif /* __BLI_VECTOR_SET_HH__ */