Closed NeeEoo closed 2 months ago
I'm definitely adding this to my modified hxcpp
I think the function should only get loaded once. The idea is that "name" (the function you are calling) starts as function pointer, pointing to the "IMPL_" function which is actually a loader function. So name should never theoretically start as the null pointer (barring static order initialization issues). The loader function overwrites the "name" function pointer to point the real version, so subsequent calls will go straight to the real function and do not even need to try loading again. I print statement should verify if this is working correctly.
I think the function should only get loaded once. The idea is that "name" (the function you are calling) starts as function pointer, pointing to the "IMPL_" function which is actually a loader function. So name should never theoretically start as the null pointer (barring static order initialization issues). The loader function overwrites the "name" function pointer to point the real version, so subsequent calls will go straight to the real function and do not even need to try loading again. I print statement should verify if this is working correctly.
Yea that would likely work! I'll work on implementing it soon
Closing this, since i noticed it broke compiling with lime somehow. If someone figures out a fix please tell me (val_string call in Font.fromFile caused issues, probs calling from a stale reference)
Its not needed to load the function every time, so its better to make it only load once