diff options
Diffstat (limited to 'source/blender/functions/FN_multi_function_signature.hh')
-rw-r--r-- | source/blender/functions/FN_multi_function_signature.hh | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/functions/FN_multi_function_signature.hh b/source/blender/functions/FN_multi_function_signature.hh index d05948cc645..2ccaa60fed6 100644 --- a/source/blender/functions/FN_multi_function_signature.hh +++ b/source/blender/functions/FN_multi_function_signature.hh @@ -30,7 +30,14 @@ namespace blender::fn { struct MFSignature { - std::string function_name; + /** + * The name should be statically allocated so that it lives longer than this signature. This is + * used instead of an #std::string because of the overhead when many functions are created. + * If the name of the function has to be more dynamic for debugging purposes, override + * #MultiFunction::debug_name() instead. Then the dynamic name will only be computed when it is + * actually needed. + */ + const char *function_name; Vector<std::string> param_names; Vector<MFParamType> param_types; Vector<int> param_data_indices; @@ -51,9 +58,9 @@ class MFSignatureBuilder { int vector_array_count_ = 0; public: - MFSignatureBuilder(std::string function_name) + MFSignatureBuilder(const char *function_name) { - signature_.function_name = std::move(function_name); + signature_.function_name = function_name; } MFSignature build() const |