<small id='V0LTK'></small><noframes id='V0LTK'>

      <tfoot id='V0LTK'></tfoot>

      • <bdo id='V0LTK'></bdo><ul id='V0LTK'></ul>
    1. <legend id='V0LTK'><style id='V0LTK'><dir id='V0LTK'><q id='V0LTK'></q></dir></style></legend>

      <i id='V0LTK'><tr id='V0LTK'><dt id='V0LTK'><q id='V0LTK'><span id='V0LTK'><b id='V0LTK'><form id='V0LTK'><ins id='V0LTK'></ins><ul id='V0LTK'></ul><sub id='V0LTK'></sub></form><legend id='V0LTK'></legend><bdo id='V0LTK'><pre id='V0LTK'><center id='V0LTK'></center></pre></bdo></b><th id='V0LTK'></th></span></q></dt></tr></i><div id='V0LTK'><tfoot id='V0LTK'></tfoot><dl id='V0LTK'><fieldset id='V0LTK'></fieldset></dl></div>

      在 C++ 中检查内存泄漏的最佳方法是什么?

      What is the best way to check for memory leaks in c++?(在 C++ 中检查内存泄漏的最佳方法是什么?)
    2. <i id='3WiLX'><tr id='3WiLX'><dt id='3WiLX'><q id='3WiLX'><span id='3WiLX'><b id='3WiLX'><form id='3WiLX'><ins id='3WiLX'></ins><ul id='3WiLX'></ul><sub id='3WiLX'></sub></form><legend id='3WiLX'></legend><bdo id='3WiLX'><pre id='3WiLX'><center id='3WiLX'></center></pre></bdo></b><th id='3WiLX'></th></span></q></dt></tr></i><div id='3WiLX'><tfoot id='3WiLX'></tfoot><dl id='3WiLX'><fieldset id='3WiLX'></fieldset></dl></div>

        <small id='3WiLX'></small><noframes id='3WiLX'>

                <tbody id='3WiLX'></tbody>
              <tfoot id='3WiLX'></tfoot>

              • <bdo id='3WiLX'></bdo><ul id='3WiLX'></ul>

                <legend id='3WiLX'><style id='3WiLX'><dir id='3WiLX'><q id='3WiLX'></q></dir></style></legend>
                本文介绍了在 C++ 中检查内存泄漏的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在实现一个带有链表的稀疏矩阵,手动检查泄漏并不好玩,有什么想法吗?

                I'm implementing a sparse matrix with linked lists and it's not fun to manually check for leaks, any thoughts?

                推荐答案

                valgrind用于 Unix 的分析器提供了不错的泄漏检测.

                The valgrind profiler for Unix offers a decent leak detection.

                然而,这只是成功方法的一部分.另一部分是防止(即最小化)显式内存处理.智能指针和分配器可以在很大程度上帮助防止内存泄漏.此外,确实使用 STL 类:std::list 已经提供了无泄漏链表实现.

                However, this is only one part of a successful approach. The other part is to prevent (i.e. minimize) explicit memory handling. Smart pointers and allocators can help a great deal in preventing memory leaks. Also, do use the STL classes: a leak-free linked list implementation is already provided by std::list.

                这篇关于在 C++ 中检查内存泄漏的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Constructor initialization Vs assignment(构造函数初始化 Vs 赋值)
                Is a `=default` move constructor equivalent to a member-wise move constructor?(`=default` 移动构造函数是否等同于成员移动构造函数?)
                Has the new C++11 member initialization feature at declaration made initialization lists obsolete?(声明时新的 C++11 成员初始化功能是否使初始化列表过时了?)
                Order of constructor call in virtual inheritance(虚继承中构造函数调用的顺序)
                How to use sfinae for selecting constructors?(如何使用 sfinae 选择构造函数?)
                Initializing a union with a non-trivial constructor(使用非平凡的构造函数初始化联合)
                <i id='DPtJp'><tr id='DPtJp'><dt id='DPtJp'><q id='DPtJp'><span id='DPtJp'><b id='DPtJp'><form id='DPtJp'><ins id='DPtJp'></ins><ul id='DPtJp'></ul><sub id='DPtJp'></sub></form><legend id='DPtJp'></legend><bdo id='DPtJp'><pre id='DPtJp'><center id='DPtJp'></center></pre></bdo></b><th id='DPtJp'></th></span></q></dt></tr></i><div id='DPtJp'><tfoot id='DPtJp'></tfoot><dl id='DPtJp'><fieldset id='DPtJp'></fieldset></dl></div>

                • <tfoot id='DPtJp'></tfoot>
                • <legend id='DPtJp'><style id='DPtJp'><dir id='DPtJp'><q id='DPtJp'></q></dir></style></legend>
                    <bdo id='DPtJp'></bdo><ul id='DPtJp'></ul>
                        <tbody id='DPtJp'></tbody>

                      <small id='DPtJp'></small><noframes id='DPtJp'>