Closed ollydev closed 5 years ago
This will fail when you try to create a closure for the same pointer twice but with a different header. Not only different calling convention, but different parameters might cause issues as well. I think in practice, every valid header with the same calling convention will pass parameters the same way under the hood, but invalid headers (after a type cast for example) might cause issues for future FFI closures.
Every call you would get a new method address so the something like the following didn't work:
Perhaps not the prettiest way, but you get a static address now.