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

Research on Memory Leak Detection Algorithm of C/C++ Program

在线阅读下载全文

作  者:仵俊 WU Jun(College of Computer Science and Technology,Nanjing University of Aeronautics and Astronautics,Nanjing 211100,China)

机构地区:[1]南京航空航天大学计算机科学与技术学院,江苏南京211100

出  处:《现代信息科技》2021年第22期98-100,共3页Modern Information Technology

基  金:国家自然科学基金:内存安全性和形式化规约的运行时验证(62172217)。

摘  要:为了获得最佳性能,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.

关 键 词:C/C++程序 内存泄漏 改进指针算法 shared_ptr 

分 类 号:TP311[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象