C_C++中内存管理的策略与应用类本科毕设论文精选.doc

 C_C++中内存管理的策略与应用类本科毕设论文精选.doc

  1. 1、本文档共36页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
 C_C中内存管理的策略与应用类本科毕设论文精选

摘要 随着计算机技术的飞速发展和内存价格的降低,现代计算机中的内存容量也在不断增加,已经达到了GB的范围。但是,系统软件和应用软件所需的存储空间也在膨胀,内存仍然不能保证有足够的空间来保存活跃的进程空间以及操作系统所需要的数据结构。因此,合理而有效地分配和使用内存资源,对计算机系统的性能影响很大。 现在,内存的使用技术已成为所有程序设计员都重视的问题。C + + 程序设计语言的动态内存机制更是为灵活地进行程序设计提供了极大方便 ,合理使用内存是提高程序可靠性和适用性的一种有效方法,但同时也增加了各种内存错误发生的机会。本文针对这一问题,首先总结了C和C++中动态内存分配函数的使用要点,然后总结并分析了 C+ + 中常见的内存错误,提出了一些解决对策和预防措施 ,最后通过加入检测区域、重载new操作符来完成C++程序中部分内存越界问题的检测。 关键词: 动态内存分配 内存泄漏 C/C++ 重载 ABSTRACT With the rapid development of computer technology and the decreasing memory prices, the memory capacity is also increasing and have reached the scope of GB.However, the storage space which the system software and the application software require is expanding greatly too . the memory is still can not contain all active processes and data structures that the operating system required. Therefore, the efficient allocation and usage of memory resources have a great influence on the performance of the system. Nowadays,every programmer must pay attention to how they use the memory.The dynamic memory mechanism provided by C++ program design language offers an easy way to design programs .It is an effective way to improve the reliability and effective of programming when using memory well,but at the same time it increases the chances of various memory errors.As to above problem ,in this paper ,summarize the usage of C and C++ dynamic memory allocation function, and then summarize and analyze mistakes about memory that people always make when designing program in C++.And then provide some solutions to them.Finally,propose a way to detecte the memory over-bounding problem through adding region-checked and overloading new operator . Keywords: Dynamic Memory Allocation Memory leak C/C++ Overload 目录 第一章 绪论 1 1.1研究目的 1 1.2内存管理的重要性 2 1.3 C/C++内存管理发展过程 2 1.4内存分配概述 3 1.4.1静态内存分配概述 3 1.4.2动态内存分配概述 3 1.5本文的基本结构 4 第二章 动态内存分配 5 2.1 C/C++程序的内存结构 5 2.2栈和堆的对比 6 2.2.1栈和堆的区别 7 2.2.2栈和堆的优势分析 8 2.3 C/C++中的动态内存分配函数 9 2.3.1 malloc函数、calloc函数和realloc 函数 9 2.3.2 free函数 11 2.3.3 new

文档评论(0)

gz2018gz + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档