Quote:
the compiler puts a sort-of id tag on those calls
|
this is basiccally it. The compiler stores any function it compiles with its signature, that is made of the types of its arguments. For example, the sig of a Double(int i) is "I", the sig for Double(float f, float f, void * data) is "FFP"
When the compiler links the code, it searches for the function with the same name, but also the same sig. This is done at link time, not runtime. In the executable, the correct function reference is already done, so no overhead.