是否需要重载operator new和delete?

时间:2014-03-30 07:19:58

标签: c++ gcc memory-management operator-overloading libstdc++

a file from squid中,我读了以下评论:

/* Any code using libstdc++ must have externally resolvable overloads
 * for void * operator new - which means in the .o for the binary,
 * or in a shared library. static libs don't propogate the symbol
 * so, look in the translation unit containing main() in squid
 * for the extern version in squid
 */

我想知道它来自哪里,陈述了这样的要求,以及gcc的版本。 libstdc ++它适用。我看到它的方式,声明在我的系统上看起来并不正确:没有鱿鱼提供这些符号的事情很好,事实上提供它们似乎cause crashes。另一方面,我认为开发人员没有添加该注释和重载的运算符back in 2003只是为了它的乐趣。我猜他们当时在某些配置中是必需的。

您能告诉我添加此类运算符定义的配置(版本,体系结构,设置......)可能是必需的,为什么?

0 个答案:

没有答案
相关问题