一些关于C++ 内存管理的比较好的文章,代码
2015-10-14 11:26
405 查看
在看一下内存管理的资料,把一些比较好的留下。
https://github.com/fffaraz/awesome-cpp
http://www.codeproject.com/Articles/541067/Cplusplus-Smart-Pointers
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.
http://www.codeproject.com/Articles/25284/Heap-Memory-Manager-and-Garbage-Collector
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.
http://www.codeproject.com/Articles/25451/C-Memory-Management-Innovation-GC-Allocator
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:
What is GC Allocator?
GC Allocator implementations: ScopeAlloc and AutoFreeAlloc
Applications based on GC Allocator
http://www.codeproject.com/Articles/8448/Memory-Leak-Detection
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.
http://www.codeproject.com/Articles/1300/CxImage
CxImage is a C++ class to load, save, display, transform BMP, JPEG, GIF, PNG, TIFF, MNG, ICO, PCX, TGA, WMF, WBMP, JBG, J2K images.
0. C++资源集锦
https://github.com/fffaraz/awesome-cpp
Awesome C/C++
1. C++11 Smart Pointers
http://www.codeproject.com/Articles/541067/Cplusplus-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 onlyon the smart pointers section of C++11.
2. Heap Memory Manager and
Garbage Collector
http://www.codeproject.com/Articles/25284/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 leaksand 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
http://www.codeproject.com/Articles/25451/C-Memory-Management-Innovation-GC-Allocator
Introduction
Most of the C++ programmers do not benefit from "GarbageCollection" 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:
What is GC Allocator?
GC Allocator implementations: ScopeAlloc and AutoFreeAlloc
Applications based on GC Allocator
4. Memory Leak Detection
http://www.codeproject.com/Articles/8448/Memory-Leak-Detection
Introduction
OK, So you want a memory leak detectorand 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.
4. CxImage
http://www.codeproject.com/Articles/1300/CxImageCxImage is a C++ class to load, save, display, transform BMP, JPEG, GIF, PNG, TIFF, MNG, ICO, PCX, TGA, WMF, WBMP, JBG, J2K images.
相关文章推荐
- 使用C++实现JNI接口需要注意的事项
- 关于指针的一些事情
- c++ primer 第五版 笔记前言
- share_ptr的几个注意点
- Lua中调用C++函数示例
- Lua教程(一):在C++中嵌入Lua脚本
- Lua教程(二):C++和Lua相互传递数据示例
- C++联合体转换成C#结构的实现方法
- C++编写简单的打靶游戏
- C++ 自定义控件的移植问题
- C++变位词问题分析
- C/C++数据对齐详细解析
- C++基于栈实现铁轨问题
- C++中引用的使用总结
- 使用Lua来扩展C++程序的方法
- C++中调用Lua函数实例
- Lua和C++的通信流程代码实例
- C与C++之间相互调用实例方法讲解
- 解析C++中派生的概念以及派生类成员的访问属性
- C++ Custom Control控件向父窗体发送对应的消息