The application of inline function in iOS--Huang Renbin

Source: Internet
Author: User
Defined:
There is the structure of the function, but not the nature of the function, similar to macro substitution. The use of inline definitions in code can form inline functions, as well as the specific processing of the compiler's definition within the body of the inner function.

The resulting motive:
Eliminate the overhead of function calls, which are suitable for functions that are frequently executed with small memory functions.

Precautions:
You cannot use a loop statement; You cannot use a switch statement; You cannot use recursive calls; it is defined before the first call;

Issues that are used in combination:
Static inline Fun_returntype fun_name (param ...) {}
Static identity This inline function can only be used in this file, limiting the scope of the inline function. In contrast to macro, static inline has the same level of overhead as macros, and it also provides type safety without the specific limitations of length and format. Here is where the last project was used to put inline functions and macros in the same header file if the call is not much, can be written in the M file extension read http://wenku.baidu.com/link?url=enUimDBZgOWlcThiy_RePb-HY9rFy Czf-ngxgryaydqg2bl9jr9c3hsc3x3-y64t7mhjtgej0qeoqchqdxfqpsklrrgmrirygl2e7bjg-yi http://wenku.baidu.com/view/ 43d2cc1d7cd184254b3535dd.html?re=view

The application of inline function in iOS--Huang Renbin

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.