期刊文献+

C/C++程序内存泄漏检测算法的研究 被引量:2

Research on Memory Leak Detection Algorithm of C/C++ Program
下载PDF
导出
摘要 为了获得最佳性能,C/C++语言把操纵内存的权限以指针的方式暴露给开发人员。但是C/C++语言编译器GCC和Clang都不提供内存安全检测,导致开发人员使用C/C++语言编写的项目可能存在内存泄漏的风险。文章介绍了改进指针算法和shared_ptr源码,分析了它们检测内存泄漏的方式,最后指出该类算法的缺陷,提出改进思路,并建议用户避免写出该类算法无法检测的代码结构。 In order to obtain the best performance, C/C++ language exposes the permission to manipulate memory to developers in the form of pointers. However, the C/C++ language compiler GCC and Clang do not provide memory security detection, which leads to the risk of memory leakage for projects written by developers in C/C++ language. This paper introduces the improved pointer algorithm and shared_ptr source code, analyzes their ways to detect memory leakage, finally points out the defects of this kind of algorithm and puts forward improvement ideas, and advises users to avoid writing code structures that cannot be detected by such algorithms.
作者 仵俊 WU Jun(College of Computer Science and Technology,Nanjing University of Aeronautics and Astronautics,Nanjing 211100,China)
出处 《现代信息科技》 2021年第22期98-100,共3页 Modern Information Technology
基金 国家自然科学基金:内存安全性和形式化规约的运行时验证(62172217)。
关键词 C/C++程序 内存泄漏 改进指针算法 shared_ptr C/C++program memory leak improved pointer algorithm shared_ptr
  • 相关文献

参考文献2

二级参考文献9

  • 1American National Standards Institude.Programming Language-C++.International Standard ISO/IEC 14882[S].New York:[s.n.],1998.
  • 2BjirnKarlsson.Boost中的智能指针.软件研发,2004,(2):15-18.
  • 3Alexandrescu A.Modern C++ Design[M].New York:Addison Wesley,2001.
  • 4Alexandrescu A.Mapping Between Types and Values[J].C/C++ Users Journal,2000(8),42-45.
  • 5Koretide. Elastos2.0 Manual[M/OL]. 2007. http://www. koretide. com. cn/download/download. php? id = 2.
  • 6Pan A. COM's Principle and COM's Application[M]. Beijing:Thc Tsinghua Press, 1999.
  • 7Rogerson D, Inside COM: Microsaft's Component Object Model[M]. [s. l.] : Microsoft Press. 1999.
  • 8Eckel B. Thinking in C + + (Seccond Edition)[M]. [s. l.]: Prentice Hall ,2002.
  • 9Koretide. Website[EB/OL]. 2007. http://www. koretide.com.cn

共引文献1

同被引文献16

引证文献2

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部