diff options
author | Jacques Lucke <jacques@blender.org> | 2021-09-14 17:08:09 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-09-14 17:08:09 +0300 |
commit | dee0b56b9216de8f37589b15be2d21cc1b946773 (patch) | |
tree | 986b930459ac12d7230e80afd41476c38d9b5bc3 /source/blender/functions/FN_field.hh | |
parent | 426e2663a0891d16a497a33b273a5cee1e09f929 (diff) |
Cleanup: simplify resource scope methods
Previously, a debug name had to be passed to all methods
that added a resource to the `ResourceScope`. The idea was
that this would make it easier to find certain bugs. In reality
I never found this to be useful, and it was mostly annoying.
The thing is, something that is in a resource scope never leaks
(unless the resource scope is not destructed of course).
Removing the name parameter makes the structure easier to use.
Diffstat (limited to 'source/blender/functions/FN_field.hh')
-rw-r--r-- | source/blender/functions/FN_field.hh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/functions/FN_field.hh b/source/blender/functions/FN_field.hh index d6259bce435..d4375b625ce 100644 --- a/source/blender/functions/FN_field.hh +++ b/source/blender/functions/FN_field.hh @@ -381,7 +381,7 @@ class FieldEvaluator : NonMovable, NonCopyable { /** Same as #add_with_destination but typed. */ template<typename T> int add_with_destination(Field<T> field, VMutableArray<T> &dst) { - GVMutableArray &varray = scope_.construct<GVMutableArray_For_VMutableArray<T>>(__func__, dst); + GVMutableArray &varray = scope_.construct<GVMutableArray_For_VMutableArray<T>>(dst); return this->add_with_destination(GField(std::move(field)), varray); } @@ -401,7 +401,7 @@ class FieldEvaluator : NonMovable, NonCopyable { */ template<typename T> int add_with_destination(Field<T> field, MutableSpan<T> dst) { - GVMutableArray &varray = scope_.construct<GVMutableArray_For_MutableSpan<T>>(__func__, dst); + GVMutableArray &varray = scope_.construct<GVMutableArray_For_MutableSpan<T>>(dst); return this->add_with_destination(std::move(field), varray); } @@ -417,10 +417,10 @@ class FieldEvaluator : NonMovable, NonCopyable { { const int field_index = fields_to_evaluate_.append_and_get_index(std::move(field)); dst_varrays_.append(nullptr); - output_pointer_infos_.append(OutputPointerInfo{ - varray_ptr, [](void *dst, const GVArray &varray, ResourceScope &scope) { - *(const VArray<T> **)dst = &*scope.construct<GVArray_Typed<T>>(__func__, varray); - }}); + output_pointer_infos_.append( + OutputPointerInfo{varray_ptr, [](void *dst, const GVArray &varray, ResourceScope &scope) { + *(const VArray<T> **)dst = &*scope.construct<GVArray_Typed<T>>(varray); + }}); return field_index; } @@ -443,7 +443,7 @@ class FieldEvaluator : NonMovable, NonCopyable { template<typename T> const VArray<T> &get_evaluated(const int field_index) { const GVArray &varray = this->get_evaluated(field_index); - GVArray_Typed<T> &typed_varray = scope_.construct<GVArray_Typed<T>>(__func__, varray); + GVArray_Typed<T> &typed_varray = scope_.construct<GVArray_Typed<T>>(varray); return *typed_varray; } |