C ++ function name demangling: what does this name suffix mean?

When I parse the Chromium binary, I notice that there are functions named in this template: _ZN6webrtc15DecoderDatabase11DecoderInfoD2Ev.part.1

If I pass this line to a C ++ filter, the output will be webrtc::DecoderDatabase::DecoderInfo::~DecoderInfo() [clone .part.1]

So what does this suffix .part.1 mean? If this indicates multiple copies of the same function, why do they need it? Is this due to the need for an independent position? I used g ++ as a compiler.

+4
source share
1 answer

This indicates that the destructor was subject to partial optimization of the GCC attachment . With this optimization, the function is only partially tied to another function, the rest is emitted into its own partial function. Since this new partial function does not implement the full function, it gives a different name, so it can exist in addition to defining the full function, if necessary.

So, it looks like DecoderDatabase :: DecoderInfo :: ~ DecoderInfo is defined as follows:

 DecoderDatabase::DecoderInfo::~DecoderInfo() { if (!external) delete decoder; } 

I assume that delete decoder calls a long series of operations, too long to be embedded in another function. The optimizer would appropriately divide these operations into a partial function. Then it will only embed part of the if (!external) function in other functions.

+8
source

All Articles