"pd/src/m_class.c" did not exist on "06013fcb9c2e22b1d9d49eaed4a42e2ca271713d"
Forked from
Jonathan Wilkes / purr-data
Source project has a limited visibility.
-
Jonathan Wilkes authored
This will allow legacy externals like iemmatrix and zexy to properly load aliases the first time when the user instantiates an object with [namespace_prefix/alias_name] This becomes relevant when there are kludge classes that essentially just "#include" the original C file of a class and add an alias_setup function which just calls the original setup routine. (For example, see iemmatrix.) However, such an approach still calls class_new with the original class name. Thus "namespace_prefix/classname" gets added to the pd_objectcreator methodspace, but "namespace_prefix/alias_name"-- which is what we want-- does not. This results in a series of 1000 recursive calls into pd_objectmaker's new_anything method. (I.e., sys_load_lib finds the "namespace_prefix/classname" is already loaded, new_anything_sends a typedmess to pd_objectmaker's new_anything method, which calls sys_load_lib, etc.) To prevent this, we just make sure to add "namespace_prefix/alias" by adding the relevant lines to class_addcreator. This should really be happening anyway-- since internal classes don't have a class_loadsym they aren't affected, and externals with aliases won't work with namespace prefix without this.
Jonathan Wilkes authoredThis will allow legacy externals like iemmatrix and zexy to properly load aliases the first time when the user instantiates an object with [namespace_prefix/alias_name] This becomes relevant when there are kludge classes that essentially just "#include" the original C file of a class and add an alias_setup function which just calls the original setup routine. (For example, see iemmatrix.) However, such an approach still calls class_new with the original class name. Thus "namespace_prefix/classname" gets added to the pd_objectcreator methodspace, but "namespace_prefix/alias_name"-- which is what we want-- does not. This results in a series of 1000 recursive calls into pd_objectmaker's new_anything method. (I.e., sys_load_lib finds the "namespace_prefix/classname" is already loaded, new_anything_sends a typedmess to pd_objectmaker's new_anything method, which calls sys_load_lib, etc.) To prevent this, we just make sure to add "namespace_prefix/alias" by adding the relevant lines to class_addcreator. This should really be happening anyway-- since internal classes don't have a class_loadsym they aren't affected, and externals with aliases won't work with namespace prefix without this.