GCC __attribute__ meaning (reference for https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Function-Att)

來源:互聯網
上載者:User
busybox/src/include/platform.h
/* FAST_FUNC is a qualifier which (possibly) makes function call faster * and/or smaller by using modified ABI. It is usually only needed * on non-static, busybox internal functions. Recent versions of gcc * optimize statics automatically. FAST_FUNC on static is required * only if you need to match a function pointer's type */#if __GNUC_PREREQ(3,0) && defined(i386) /* || defined(__x86_64__)? *//* stdcall makes callee to pop arguments from stack, not caller */# define FAST_FUNC __attribute__((regparm(3),stdcall))/* #elif ... - add your favorite arch today! */#else# define FAST_FUNC#endif
busybox中經常有這種聲明:再看FAST_FUNC屬性函數的定義格式: 
在gcc編譯器中
__attribute__((regparm(3),stdcall))的含義是:
regparm (number)
 On the Intel 386, the regparm attribute causes the compiler to pass up to number integer arguments in registers EAX, EDX, and ECX instead of on the stack. Functions that take a variable number of arguments will continue to be passed all of their arguments on the stack.  stdcall On the Intel 386, the stdcall attribute causes the compiler to assume that the called function will pop off the stack space used to pass arguments, unless it takes a variable number of arguments.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.