Functions: use raw allocator for function signature
authorJacques Lucke <jacques@blender.org>
Tue, 30 Jun 2020 16:01:14 +0000 (18:01 +0200)
committerJacques Lucke <jacques@blender.org>
Tue, 30 Jun 2020 16:18:48 +0000 (18:18 +0200)
This allows multi-functions to have static storage duration.

source/blender/functions/FN_multi_function_signature.hh

index 73e7b9bb18db984b1ad71b5e392b52070fdce904..77a8ce14c036b534a3accd69d2d2d8608256649b 100644 (file)
@@ -33,9 +33,10 @@ namespace fn {
 
 struct MFSignature {
   std::string function_name;
-  Vector<std::string> param_names;
-  Vector<MFParamType> param_types;
-  Vector<uint> param_data_indices;
+  /* Use RawAllocator so that a MultiFunction can have static storage duration. */
+  Vector<std::string, 4, RawAllocator> param_names;
+  Vector<MFParamType, 4, RawAllocator> param_types;
+  Vector<uint, 4, RawAllocator> param_data_indices;
 
   uint data_index(uint param_index) const
   {