需要帮助破译 gprof 输出

发布于 2024-09-06 20:52:29 字数 735 浏览 2 评论 0原文

我很确定这与 void 函数指针向量有关,但我无法真正从中得到任何东西。

有人可以帮我解决这个问题吗?

__gnu_cxx::__normal_iterator<unsigned long long const*, std::vector<unsigned long long, std::allocator<unsigned long long> > >::difference_type __gnu_cxx::operator-<unsigned long long const*, unsigned long long const*, std::vector<unsigned long long, std::allocator<unsigned long long> ...> >(__gnu_cxx::__normal_iterator<unsigned long long const*, std::vector<unsigned long long, std::allocator<unsigned long long> > > const&, __gnu_cxx::__normal_iterator<unsigned long long const*, std::vector<unsigned long long, std::allocator<unsigned long long> > > const&)

I am pretty sure this has something to do with a vector of void function pointers, but I can't really make anything out of it.

Can someone break this down for me?

__gnu_cxx::__normal_iterator<unsigned long long const*, std::vector<unsigned long long, std::allocator<unsigned long long> > >::difference_type __gnu_cxx::operator-<unsigned long long const*, unsigned long long const*, std::vector<unsigned long long, std::allocator<unsigned long long> ...> >(__gnu_cxx::__normal_iterator<unsigned long long const*, std::vector<unsigned long long, std::allocator<unsigned long long> > > const&, __gnu_cxx::__normal_iterator<unsigned long long const*, std::vector<unsigned long long, std::allocator<unsigned long long> > > const&)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

回梦 2024-09-13 20:52:29

如果我是正确的,这可以粗略地翻译为:

// Typedef for brevity
typedef vector<unsigned long long>::iterator uv_iter;
// Actual function
uv_iter::difference_type operator-(const uv_iter &, const uv_iter &);

所以,它可能指的是计算向量的两个迭代器之间的差(=距离)的函数。无论如何,当优化器启用此类函数时,实际上应该将其转换为简单的内联指针比较。

If I am correct, this could be roughly translated to:

// Typedef for brevity
typedef vector<unsigned long long>::iterator uv_iter;
// Actual function
uv_iter::difference_type operator-(const uv_iter &, const uv_iter &);

So, probably it is referring to the function that computes the difference (=distance) between two iterators of a vector. Anyhow, when the optimizer is on such function should actually be turned in a simple inlined pointers comparison.

人间☆小暴躁 2024-09-13 20:52:29

它似乎与减去两个 std::vector::iterator 有关。

It appears to be related to subtracting two std::vector<unsigned long long>::iterators.

黒涩兲箜 2024-09-13 20:52:29

这是减法运算符 (operator-),用于将两个迭代器的差值放入 unsigned long long 向量中。在普通 C++ 中,如果没有所有分配器和额外的模板参数,此函数签名将如下所示:

std::vector<unsigned long long>::iterator::difference_type operator- 
  (const std::vector<unsigned long long>::iterator& first,
   const std::vector<unsigned long long>::iterator& second);

其中 std::vector::iterator::difference_type 通常与ptrdiff_t

This is the subtraction operator (operator-) for taking the difference of two iterators into vectors of unsigned long longs. In normal C++, without all of the allocators and extra template parameters, this function signature would look like this:

std::vector<unsigned long long>::iterator::difference_type operator- 
  (const std::vector<unsigned long long>::iterator& first,
   const std::vector<unsigned long long>::iterator& second);

Where std::vector<unsigned long long>::iterator::difference_type is normally the same as ptrdiff_t.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文