What's the benefit of metal function pointers (focusing on visible functions rather than intersection functions), when the same functionality can be achieved without these newer features?
For the same functionality, in place of every index of the function table, have an external function. In place of every indexing into the tableT[i]
, have a switch statement that matches i
to the corresponding external function.
- For the case of visible functions statically linked, instead of using the
functions
array oflinkedFunctions
, use theprivate
functions array. - For the case of visible functions dynamically linked, instead of using the
binaryFunctions
array oflinkedFunctions
, use functions from a dynamic library.