且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C ++函数名称解析:这个名称后缀是什么意思?

更新时间:2022-12-03 11:50:53

它表示析构函数是 GCC的部分内联优化。通过这种优化,函数仅部分内联到另一个函数中,剩余部分被发射到其自身的部分函数中。因为这个新的部分函数没有实现完整的函数,它给了一个不同的名字,所以如果必要,它可以存在于完整函数的定义之外。

It indicates that destructor was the target of a partial inlining optimization by GCC. With this optimization the function is only partially inlined into another function, the remainder gets emitted into its own partial function. Since this new partial function doesn't implement the complete function it's given a different name, so it can exist beside a definition of the complete function if necessary.

看起来像是 DecoderDatabase :: DecoderInfo :: 〜DecoderInfo 定义如下:

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

我的猜测是删除解码器调用一系列长时间的操作,以便内联到另一个函数中。优化器将相应地将这些操作拆分为部分函数。然后它只会将 if(!external)部分内嵌到其他函数中。

My guess is that delete decoder invokes a long series of operations, too long to be inlined into another function. The optimizer would accordingly split those operations into a partial function. It would then only inline the if (!external) part of the function into other functions.