检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:仵俊 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[自动化与计算机技术—计算机软件与理论]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:3.145.68.176