Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2162
  • 博文数量: 2
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 15
  • 用 户 组: 普通用户
  • 注册时间: 2015-09-30 13:27
个人简介

爱好编程,最爱C++编程

文章分类
文章存档

2015年(2)

我的朋友
最近访客

分类: C/C++

2015-09-30 14:14:37

在看一下内存管理的资料,把一些比较好的留下。


1. C++11 Smart Pointers

Introduction

Ooops. Yet another article on smart pointers of C++11. Nowadays I hear a lot of people talking about the new C++ standard which is nothing but C++0x/C++11. I went through some of the language features of C++11 and it's really an amazing work. I'll focus only on the smart pointers section of C++11.


2. Heap Memory Manager and Garbage Collector

Introduction

This article demonstrates a method to try and solve a common problem hated by most C++ programmers:memory leaks and memory overruns. The method used in this article is to track all memory allocated by the program. It also has basic protection checks whether the memory written to the allocated block has overrun the number of bytes actually allocated.

This method also lets you organize and group allocated memory by ID or by name. Giving a name to a memoryallocation gives the advantage that you can get the memory allocated by name while not needing to keep a pointer running around. Giving a group ID to an allocation helps the programmer to keep memory allocations grouped and thus can call a single function to deallocate all memory of a certain group.

3. C++ Memory Management Innovation: GC Allocator

/>

Introduction

Most of the C++ programmers do not benefit from "Garbage Collection" technique (GC). They are sick of deleting objects but have to do this. There are some C/C++ memory GC implementations, but they are complex and are not widely used.

I am going to introduce a new memory management technique named "GC Allocator". "GC Allocator" isn't an implementation, but a concept. Now, we have two "GC Allocator" implementations, named "AutoFreeAlloc" and "ScopeAlloc".

This article consists of three parts:

  1. What is GC Allocator?
  2. GC Allocator implementations: ScopeAlloc and AutoFreeAlloc
  3. Applications based on GC Allocator

4. Memory Leak Detection

/>

Introduction

OK, So you want a memory leak detector and don't want to pay thru the nose for it! You've gone ahead and read all the articles on Memory Leak Detection (whew!!) and are totally confused and frustrated with all the technical details on how to hook memory, walk a stack, display symbols and still get the performance you need to run your application. You've Looked at lots of code and found that it's kind of a big mess to add your ownmemory leak detection. Well I hope that I can help out and clear the air. I have managed to create a single class that you can add to your code and find those pesky memory leaks. You can do this in debug mode or final release mode and customize your own memory leak detection.

阅读(626) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:Linux 开发资料

给主人留下些什么吧!~~