做了几个实验,简单学习了解一下函数调用的开销。
程序1—没有参数的函数调用:
#include <stdio.h> void test() { return; } int main(int argc, char *argv[]) { test(); return 0; }
用gcc -S得到程序1的汇编代码:
.file "test.c" .text .globl test .type test, @function test: pushl