Proposed Change to Signature of ARCH_CONSTRUCTOR / ARCH_DESTRUCTOR Macros

Hello, I would like to let you know about a change we would like to make to the ARCH_CONSTRUCTOR / ARCH_DESTRUCTOR macros. These low level macros are used to execute code on library load / unload. Currently, a variable length list of typenames is used (in addition to the name parameter) as a way to generate unique static constructor function signatures. For compatibility with emscripten we would like to remove the variable length parameter from these macros as it will not be used in any way going forward.

We suspect that the majority of users only indirectly interact with this family of macros through the use of TF_REGISTRY_FUNCTION. In this common use case, the proposed change is transparent to any callers. Due to the fact this could cause breakage if these macros are used directly, we are reaching out to the community to find out if anyone is using them in such a way that this change would be disruptive.

Thanks for your input!

I don’t know enough to have an opinion about the main question here, but just wanted to point out that TF_REGISTRY_FUNCTION_WITH_TAG is also widely used, and support for it should be maintained as well as the simpler TF_REGISTRY_FUNCTION.

Hello Mark,

Apologies, I should have been more specific in my initial posting and noted that the family of TF_REGISTRY_FUNCTION macros will be updated. Indeed uses of the TF_REGISTRY_FUNCTION_WITH_TAG will not require any change by callers.