You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
implicit function calling convention resolution #105
Currently if you try to put an export function and a non-extern function in an array, you get an error because the types don't match: extern functionts and non-extern functions have different calling conventions. Same is true for "cold" functions.
However, we can always use the C calling convention - the other conventions are just more optimal if we don't have to. So when the user would get a calling convention type mismatch, instead, cause the calling convention of the affected functions to all switch to the C calling convention, then all the types are satisfied and the user doesn't have to care that a function was declared "cold" or "export".
This is a non-local performance hazard, C's calling conventions is slower than fastcall and it would be extremely hard to debug performance issues if it was inferred. Explicit casting isn't that bad and fits in with Zig's philosophy of explicitness.
Activity
eira-fransham commentedon May 29, 2018
This is a non-local performance hazard, C's calling conventions is slower than fastcall and it would be extremely hard to debug performance issues if it was inferred. Explicit casting isn't that bad and fits in with Zig's philosophy of explicitness.