On 2012-02-06, at 12:53 PM, Álvaro Castro-Castilla wrote:
Does it really reduce code size to wrap the function instead of explicitly cast? I've always believed that casts are mostly a compiler artifact coming from static typing, didn't usually generate complex code for runtime...
Relatively speaking, there is quite a bit of code generated for each c-lambda in the code. So if you write your code so that there is a single c-lambda (the "wrapper"), it will be more compact. The casts themselves don't add code. It is the calls to the type conversion functions and the exception handling code.
Marc