The ABI, or Application Binary Interface, defines how binaries interact with each other on a particular platform and includes a calling convention. Most ABIs have one design flaw that slows down performance.
Let's start by looking at the System V ABI for the x86 processor line. The ABI classifies function arguments into a number of different categories; we will only consider two:
INTEGER: , .
MEMORY: , .
; , :
, INTEGER .
, MEMORY .
, , , .
, , .
? , , , . , ; , , .
:
void foo(int*);
void bar(void);
int x = 5;
foo(&x); // , foo &x
x = 7;
bar(); // , bar x
return x; // , ;
// ( , x , , , .)
restrict
! foo
restrict
, foo (C11Β§6.7.3.1p4,11). , . , restrict
C , , , ABI C .
, ABI . void foo
(struct bla
) , void foo
(const struct bla *restrict
), , .
, System V. ABI? Microsoft , :
[ ] , .
( , , ), . Β«, Β», , , - .
ABI! ARM (, AAA arch 64):
, 16 , , , .
RISC-V:
2ΓXLEN [: ?] .
[...]
, , .
PowerPC:
[] (GPR), , .
MIPS n32:
(structs), (unions), (doublewords), , , , , .
.
ABI immutable , . , , , , . , .
, ABI!
:
"C++ Developer. Professional". , , , .