条款50:了解 new 和 delete 的合理替换时机
Understand when it makes sense to replace new and delete.
有三个主要的理由使客户想要替换编译器的 operator new
或 operator delete
:
用来检测运用上的错误;
为了强化效能;
为了增加分配和归还的速度;
为了降低缺省内存管理器带来的空间额外开销;
为了弥补缺省分配器中的非最佳齐位;
为了将相关对象成簇集中;
为了获得非传统的行为;
为了收集使用上的数据;
Last updated
Was this helpful?