今天无聊,突然想到还没看过inline的实现,就写了个小程序dump出来看看。结果发现inline函数的调用还是通过call指令做的,参数的压栈过程和普通调用一样。突然就疑惑了,gcc的inline难道和我们平时说的inline不一样?
[code]
static inline int test(int a, int b)
{
return (a+b);
};
int main()
{
int c = test(1,2);
}
[/code]
dump后的部分程序
[code]
08048334
by zx_wing - C/C++ - 2007-04-15 17:35:38 阅读(1712) 回复(4)
[code]#include
in kernel module,I need to call a function write by c,I code like this: void test(int a){ { .... } ... asm("SAVE_ALL pushl %%eax; call *%0; addl $16,%esp; RESTORE_ALL " : : "m" (&test) ); this will caught a kernel error,every one who know can help me? Thanks!
I think, therefore I am. —René Descartes The primary purpose of this book is to help you pass the Sun Certified System Administrator for Solaris 10 Exams CX-310-200 and CX-310-202. Since the book has a laser-sharp focus on the exam objectives, expert system administrators who want to pass the exam can use this book to ensure that they do not miss any objective. Yet, it is not an exam cram 【死记...
Chapter 1. introductionBackground In early 2004, Martin Fowler asked the readers of his site: when talking about Inversion of Control: “the question is, what aspect of control are [they] inverting?”. Fowler then suggested renaming the principle (or at least giving it a more self-explanatory name), and started to use the term Dependency Injection. His article then cont...
本人今天遇到一个问题不明白 希望大家指点一下 就是inline函数的连接问题,问题是这样的 假如把inline函数的声明和定义一起写,形如 inline void ADD_ONE_LINE_XML_STR(const char* szNodeName,const char* szNodeValue,std::string& sXml) { char szTmp[1024] = {0}; snprintf(szTmp,sizeof(szTmp),"<%s>%s>\n",szNodeName,szNodeValue,szNodeName); sXml.append(szTmp); } 那么使用是不会有问题的,但是假如...
Django is opensource Web framework written in Python. Django loosely follows MVC design pattern. Django being written in Python you should have some knowledge of Python. You can download Django from http://www.djangoproject.com/download . I have been using Django since its 0.96 release. Today I decided to write a small application using it. As Django follows design pattern similar to MVC lets fi...
What is InfiniBand ->A superset of the Virtual Interface Architecture ->Powerful new architecture designed to support I/O connectivity for the Internet infrastructure ->A switched fabric communications link primarily used in HPC and EDC, a high-bandwidth, low-latency interconnect architecture. ->Defines a connection between processor nodes and high performance I/O nodes (storage devices) ->Point...
introduction to MySQL By Blair Ireland Senior Editor, TheScripts.com Modern day web sites seem to be relying more and more on complex database systems. These systems store all of their critical data, and allow for easy maintenance in some cases. The Structured Query Language (SQL) is a very popular database language, and its standardization makes it quite easy to store, up...
转载:http://blog.chinaunix.net/u/1337/showart_16143.html 1. 定义 InfiniBand是主机IO总线的网络化,用以替代PCI总线,组件包括HCA、IBSwitch、TCA等,连接方式为:CPU/RAM(机内)—>系统内存总线(机内)—>HCA(桥,机内)—>IBSwitch(主机IO总线,机外)—>TCA(主机IO控制卡 /HBA,机外)—>SANSwitch(存储IO总线,机外)—> 存储子系统(机外)。 2. 结构 物理层:可基于光缆或铜缆实现,包括多芯电缆...