diff options
Diffstat (limited to 'source/blender/blenlib/BLI_cpp_type.hh')
-rw-r--r-- | source/blender/blenlib/BLI_cpp_type.hh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_cpp_type.hh b/source/blender/blenlib/BLI_cpp_type.hh index ed680214602..8cf5ead1c7b 100644 --- a/source/blender/blenlib/BLI_cpp_type.hh +++ b/source/blender/blenlib/BLI_cpp_type.hh @@ -20,7 +20,7 @@ * cost of longer compile time, a larger binary and the complexity that comes from using * templates). * - If the code is not performance sensitive, it usually makes sense to use #CPPType instead. - * - Sometimes a combination can make sense. Optimized code can be be generated at compile-time for + * - Sometimes a combination can make sense. Optimized code can be generated at compile-time for * some types, while there is a fallback code path using #CPPType for all other types. * #CPPType::to_static_type allows dispatching between both versions based on the type. * @@ -626,6 +626,11 @@ class CPPType : NonCopyable, NonMovable { fill_construct_indices_(value, dst, mask); } + bool can_exist_in_buffer(const int64_t buffer_size, const int64_t buffer_alignment) const + { + return size_ <= buffer_size && alignment_ <= buffer_alignment; + } + void print(const void *value, std::stringstream &ss) const { BLI_assert(this->pointer_can_point_to_instance(value)); |