How do the va_arg
va_start
va_list
va_end
macros work under the hood in x64?
The calling convention in i386 passes parameters on the stack, hence the macro just increments some pointer that points to the stack base and forwards it.
However, in x64, all parameters are passed by registers.... so what happens there? How does the called function know which registers were used to pass arguments to ensure it doesn't clobber them?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…