busybox中FAST_FUNC

busybox的FAST_FUNC是一个可能使函数调用更快、更小的修饰符,特别是在非静态内部函数上。当使用GCC 3.0及更高版本且目标为i386架构时,FAST_FUNC会使用stdcall属性,让被调用者负责从堆栈中弹出参数。否则,FAST_FUNC不定义。此功能在某些架构下可以优化参数传递方式,减少堆栈使用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


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
# 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值