g++以静态成员为键的 gprof 全局构造函数
我正在 Linux 上分析使用 g++ 编译的 C++ 应用程序。
在 gprof 输出中,我得到了一些重要的使用统计信息:
global constructors keyed to _ZN4CGps14ms_OutputNamesE
其中 _ZN4CGps14ms_OutputNamesE 是我的类之一的静态成员的损坏名称。它是一个 std::strings 数组:
static std::string ms_OutputNames[MAXOUTPUTS];
我有点惊讶的是,它没有在应用程序开始时被构造一次。是否正在进行某种保护变量或首次使用检查?我将如何优化这个?
I'm profiling a c++ app on linux compiled with g++.
In the gprof output I'm getting some nontrivial usage statistics for:
global constructors keyed to _ZN4CGps14ms_OutputNamesE
Where _ZN4CGps14ms_OutputNamesE is the mangled name of a static member of one of my classes. It's an array of std::strings:
static std::string ms_OutputNames[MAXOUTPUTS];
I'm a bit surprised that this isn't being constructed once at the beginning of the app. Is there some sort of guard variable or first usage check going on? How would I go about optimising this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论