当前位置:网站首页>Common GCC__ attribute__
Common GCC__ attribute__
2022-06-24 17:16:00 【mariolu】
When I study brpc. Browse the code , View many “ __attribute__ Used places ”.
I'm thinking about what to use under what circumstances “ __attribute__”? Use it properly __attribute Coding can improve the efficiency of the program . According to my investigation , Here are some examples .
- __attribute __(noinline): Prevent thinking about inlining functions
- __attribute __(packed): Specifies that each member of a structure or union is placed to minimize the memory required . The
packedProperty specifies that structure members should have the smallest possible alignment - __attribute __(unused): Informs the compiler that you expect variables to be unused , And tell it not to give a warning if you don't use it
- __attribute __(weak): Define library functions that can be overridden in user code
- __attribute __(format): from printf Use and point out what args With format
- __ attribute __(const): This function does not read or modify any global memory
- __attribute __(aligned(X)): Increase the alignment of structures or structure members . Minimum alignment , In bytes . You cannot use this property to reduce the alignment of functions , You can only increase its alignment .
- __attribute __(unused): This attribute attached to a variable means that the variable may not be used .GCC No warning will be issued for this variable .
- __attribute __(always_inline): Usually , Unless optimization is specified , Otherwise, the function will not be inlined . For inline declared functions , Even if the optimization level is not specified , This property will also inline functions .
- __attribute __(deprecated): If you use this variable anywhere in the source file , This attribute will generate a warning .
边栏推荐
- Robot toolbox matlab robotics toolbox
- [playing with Tencent cloud] a solution to the impassability of cross-border access to foreign websites using Tencent cloud CVM
- Is CICC securities reliable? Is it legal? Is it safe to open a stock account?
- Try catch finally implementation mechanism
- [tke] enable CPU static management strategy
- What securities dealers recommend? Is it safe to open an account online now?
- Solution to the problem that kibana's map cannot render longitude and latitude coordinate data
- ClassNotFoundException v/s NoClassDefFoundError
- [kotlin] constructor summary
- Edit distance (linear dp+ violence matching)
猜你喜欢

Daily algorithm & interview questions, 28 days of special training in large factories - the 15th day (string)
![[leetcode108] convert an ordered array into a binary search tree (medium order traversal)](/img/e1/0fac59a531040d74fd7531e2840eb5.jpg)
[leetcode108] convert an ordered array into a binary search tree (medium order traversal)

Why do you develop middleware when you are young? "You can choose your own way"

MySQL learning -- table structure of SQL test questions
随机推荐
"Competition" and "opportunity" hidden in security operation in the cloud Era
The RTSP video image intelligent analysis platform easynvr cascades to the superior platform through the national standard for playback optimization
Implement typescript runtime type checking
Devops in digital transformation digital risk
FPGA systematic learning notes serialization_ Day10 [sequential logic, competitive adventure, synchronous reset, asynchronous reset]
GB gb28181 video cascading intelligent analysis platform easygbs broadcast video console error 401
Tencent cloud database mysql:sql flow restriction
Quick view of product trends in February 2021
[web] what happens after entering the URL from the address bar?
[play with Tencent cloud] TSF User Guide
[tke] whether to configure SNAT when the container accesses services outside the node
[go language development] start to develop Meitu station from 0 - Lesson 5 [receive pictures and upload]
How does the easynvr/easygbs live video platform use Wireshark to capture and analyze data locally?
[play with Tencent cloud] check 9 popular Tencent cloud products
A comprehensive understanding of fiber to home FTTH and optical splitter
05. Tencent cloud IOT device side learning -- mqtt protocol client implementation
Tiktok Kwai, e-commerce enters the same river
In those years, I insisted on learning the motivation of programming
Building a cross public chain platform to solve DAPP development problems
[2021 taac & Ti-One] frequently asked questions related to Ti-One products