﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-Daly的游戏人生-随笔分类-C/C++</title><link>http://www.cppblog.com/daly88/category/12301.html</link><description /><language>zh-cn</language><lastBuildDate>Fri, 07 Dec 2012 18:39:12 GMT</lastBuildDate><pubDate>Fri, 07 Dec 2012 18:39:12 GMT</pubDate><ttl>60</ttl><item><title>替代系统malloc/new--选择合适的内存跟踪方案</title><link>http://www.cppblog.com/daly88/archive/2012/07/02/181131.html</link><dc:creator>Daly</dc:creator><author>Daly</author><pubDate>Mon, 02 Jul 2012 05:01:00 GMT</pubDate><guid>http://www.cppblog.com/daly88/archive/2012/07/02/181131.html</guid><wfw:comment>http://www.cppblog.com/daly88/comments/181131.html</wfw:comment><comments>http://www.cppblog.com/daly88/archive/2012/07/02/181131.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/daly88/comments/commentRss/181131.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/daly88/services/trackbacks/181131.html</trackback:ping><description><![CDATA[<span style="font-family: Arial; font-size: 12pt">&nbsp; </span>
<div>
<div><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: 12pt Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">替代系统自带的malloc/new原因无非两个：&nbsp;</span></div>
<div><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: 12pt Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">reason 1. 做内存profile或查找问题 &nbsp;&nbsp;</span></div>
<div><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: 12pt Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">reason 2. 自定义的分配方案提高性能</span></div>
<div><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium Tahoma; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><br /></span></div>
<div><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: 12pt Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">不过文章[1]中说明了，替代全局new不是一个好做法. 其实要达到以上两点目的，笔者认为用valgrind工具链就可以了。</span></div>
<div><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium Tahoma; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><br /></span></div>
<div><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: 12pt Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><strong>解决方案：</strong></span></div>
<div><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12pt; line-height: normal; font-family: Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: #0000ff; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: initial; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">1. 用valgrind和massif</span></div>
<div><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: 12pt Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp; &nbsp; &nbsp;valgrind的memcheck做内存泄露和bug的查找, 里面的massif工具包做内存性能profile, 足矣。比自己山寨的一个profiler要好。</span></div>
<div><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: 12pt Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp; &nbsp; &nbsp;注意：tcmalloc目前还不能很好支持valgrind,&nbsp; 实测中jemalloc可以</span></div>
<div><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium Tahoma; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><br /></span></div>
<div><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12pt; line-height: normal; font-family: Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: #0000ff; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: initial; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">2. &nbsp;linux下C的程序可以用wrap的方式(相当于python的decorator)</span></div>
<div><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: 12pt Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: 12pt Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">编译加上选项：gcc -Wl,-wrap,malloc</span></div>
<div><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: 12pt Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp; &nbsp; &nbsp;可以做到对malloc这个函数，linker会调用__wrap_malloc代替之, 若要调用原来的malloc函数__real_malloc</span></div>
<div><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium Tahoma; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: 12pt Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp; &nbsp; &nbsp;缺点：依赖于编译器支持； 对c++的new不起作用 --&gt; 不实用</span></span></div>
<div><span style="font-family: Arial; font-size: 12pt">&nbsp; &nbsp; &nbsp;启示：这个方法作为function装饰器，对于调试别的问题倒有帮助。（例如不改变函数的情况下，wrap一层，输出些调试信息)</span></div>
<div></div>
<div><span style="font-family: Arial; font-size: 12pt; color: #0000ff;">3. 用__malloc_hook</span></div>
<div><span style="font-family: Arial; font-size: 12pt">&nbsp; &nbsp; 参考：&nbsp;</span><a href="http://linux.die.net/man/3/__malloc_hook"><span style="font-family: Arial; font-size: 12pt">http://linux.die.net/man/3/__malloc_hook</span></a></div>
<div><span style="font-family: Arial; font-size: 12pt">&nbsp; &nbsp; &nbsp;#include &lt;malloc.h&gt;</span></div><pre style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: #ffffff; text-indent: 0px; padding-left: 0px; padding-right: 2em; font: 12px monospace; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: Arial; font-size: 12pt">     void *(*__malloc_hook)(size_t size, const void *caller);</span><br /></pre><pre style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: #ffffff; text-indent: 0px; padding-left: 0px; padding-right: 2em; font: 12px monospace; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-family: Arial; font-size: 12pt">     缺点：依赖GNU编译工具链;  容易死循环(想利用原有malloc，要参考例子中，把原__malloc_hook变量保存起来使用，并恢复现场)
</span></pre>
<div><span style="font-family: Arial; font-size: 12pt"><br /></span><span style="font-family: Arial; font-size: 12pt; color: #0000ff;">4. LD_PRELOAD注入.so ，替代原</span></div>
<div>&nbsp; &nbsp;&nbsp;<span lang="EN-US"><span>&nbsp;</span></span><span style="font-family: Arial; font-size: 12pt">环境变量</span><span style="font-family: Arial; font-size: 12pt" lang="EN-US">LD_PRELOAD</span><span style="font-family: Arial; font-size: 12pt">指定程序运行时优先加载的动态连接库，这个动态链接库中的符号优先级是最高的。标准</span><span style="font-family: Arial; font-size: 12pt" lang="EN-US">C</span><span style="font-family: Arial; font-size: 12pt">的各种函数都是存放在</span><span style="font-family: Arial; font-size: 12pt" lang="EN-US">libc.so.6</span><span style="font-family: Arial; font-size: 12pt">的文件中，在程序运行时自动链接。使用</span><span style="font-family: Arial; font-size: 12pt" lang="EN-US">LD_PRELOAD</span><span style="font-family: Arial; font-size: 12pt">后，自己编写的</span><span style="font-family: Arial; font-size: 12pt" lang="EN-US">malloc</span><span style="font-family: Arial; font-size: 12pt">的加载顺序高于</span><span style="font-family: Arial; font-size: 12pt" lang="EN-US">glibc</span><span style="font-family: Arial; font-size: 12pt">中的</span><span style="font-family: Arial; font-size: 12pt" lang="EN-US">malloc</span><span style="font-family: Arial; font-size: 12pt">，这样就实现了替换。用法</span><span style="font-family: Arial; font-size: 12pt">&nbsp;LD_PRELOAD=" ./mymalloc.so"</span></div>
<div><span style="font-family: Arial; font-size: 12pt">&nbsp; &nbsp; &nbsp; 缺点：在生产环境不现实。因为LD_PRELOAD相当于库注入，有安全性问题，是必须禁止的。(生产环境很多时候用-static连接)</span></div>
<div></div>
<div><span style="font-family: Arial; font-size: 12pt; color: #0000ff;">5. 用宏或另外的函数替代new/malloc</span></div>
<div><span style="font-family: Arial; font-size: 12pt">&nbsp; &nbsp;比如定义一个宏或者指定的函数，规定所有的分配释放都调用他。这样相当于给项目引入了额外的代码规则(而且是一立项就要遵循这个规则，否则该方法无效），不能很自然的new/delete, 如果分配和释放调用得不一致，会产生问题的。某产品组就是用宏，然后加上__FILE__, __LINE__之类的信息。<br /><br />&nbsp;有时候valgrind的效率是个问题(尤其生产环境)，这种方案有其价值所在, 就是代码看上去比较ugly罢了<br /><br /></span></div>
<div><span style="font-family: Arial; font-size: 12pt">&nbsp; &nbsp;用宏的例子：</span></div>
<div><span style="font-family: Arial; font-size: 12pt">&nbsp; &nbsp;#define _New(Type, Catergory)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Type*)MyMemController::New((new Type), #Type, 1, sizeof(Type),&nbsp;&nbsp; Catergory, __FILE__, __LINE__, false)</span></div>
<div><span style="font-family: Arial; font-size: 12pt">&nbsp; &nbsp;#define _NewArray(Type, N, Catergory)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Type*)MyMemController::New((new Type[N]), #Type, N, sizeof(Type)*(N), Catergory, __FILE__, __LINE__, true)</span></div>
<div><span style="font-family: Arial; font-size: 12pt"><br />&nbsp;&nbsp;&nbsp;</span></div>
<div><strong>MALLOC的替代品：</strong></div>
<div><span style="font-family: Arial; font-size: 12pt">&nbsp; &nbsp; &nbsp;自己写一个malloc其实很复杂，要考虑线程安全等各种问题，性能到头来可能更差。google 的tcmalloc, &nbsp;facebook使用的jemalloc. &nbsp; 多线程下性能较好，可以考虑使用。<br /></span></div>
<div><span style="font-family: Arial; font-size: 12pt">&nbsp; &nbsp; &nbsp;缺点：笔者尝试过。tcmalloc不能正确用valgrind,只能用自带gperftools（运行中会core)</span></div>
<div><span style="font-family: Arial; font-size: 12pt">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;jemalloc可以使用valgrind，不过还没完全验证是否都准确。</span></div>
<div></div>
<div><span style="font-family: Arial; font-size: 12pt"><strong>tcmalloc相关:</strong></span></div>
<div><span style="font-family: 宋体"><font color="#7600d8"><span style="font-family: Arial; font-size: 12pt">&nbsp;&nbsp;&nbsp;&nbsp;</span></font></span><span style="line-height: normal; widows: 2; text-transform: none; font-variant: normal; font-style: normal; text-indent: 0px; border-collapse: separate; font-family: 宋体; white-space: normal; orphans: 2; letter-spacing: normal; font-size: medium; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><font size="+0"><span style="font-family: Arial; font-size: 12pt">在64位系统上要装libunwind, 对x86-64架构使用还有些问题<br /><br /></span></font></span></div>
<div><font face="宋体"><span style="font-family: Arial; font-size: 12pt">源码包的INSTALL文档里面也提到了这个问题。<br />&nbsp;CAUTION: if you install libunwind from the url above, be aware that<br />&nbsp;&nbsp; you may have trouble if you try to statically link your binary with<br />&nbsp;&nbsp; perftools: that is, if you link with 'gcc -static -lgcc_eh ...'.<br />&nbsp;&nbsp; This is because both libunwind and libgcc implement the same C++<br />&nbsp;&nbsp; exception handling APIs, but they implement them differently on<br />&nbsp;&nbsp; some platforms.&nbsp; This is not likely to be a problem on ia64, but<br />&nbsp;&nbsp; may be on x86-64.<br /><br />主要是64位机frame-pointer的影响, 他的profile工具里的backtrace用libunwind这个库，这个库又有版本问题，各种囧啊....</span></font></div>
<div><font face="宋体"><span style="font-family: Arial; font-size: 12pt">笔者试过系统x86-64, freebsd，用静态链接。实际用了一下，问题很多很折腾，等他fix了再说吧.<br /><br /></span></font></div>
<div><span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium 宋体; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><font color="#7600d8"><span style="color: #000000">windows下可以参考：</span> 
<div><span style="line-height: normal; widows: 2; text-transform: none; font-variant: normal; font-style: normal; text-indent: 0px; border-collapse: separate; font-family: 宋体; white-space: normal; orphans: 2; letter-spacing: normal; font-size: medium; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a href="http://www.cppblog.com/feixuwu/archive/2010/07/10/119980.aspx"><font size="+0"><span style="font-family: Arial; font-size: 12pt">http://www.cppblog.com/feixuwu/archive/2010/07/10/119980.aspx</span></font></a></span></div><br /><br /><span style="color: #000000">jemalloc暂时未发现有什么兼容性问题，运行得挺好的。</span><br /></font></span></div>
<div>&nbsp;</div>
<div><span style="font-family: Arial; font-size: 12pt">Reference</span><br /><span style="font-family: Arial; font-size: 12pt">[1] </span><a href="http://www.cppblog.com/Solstice/archive/2011/02/22/140410.aspx"><span style="font-family: Arial; font-size: 12pt">&lt;不要重载全局operator new&gt;</span></a></div>
<div>
<h1 style="widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 0.4em; font-style: normal; font-variant: normal; font-size: 14px; line-height: 19px; font-family: Calibri, 'Trebuchet MS', Tahoma, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; text-decoration: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span style="font-weight: normal;"><span style="font-family: Arial; font-size: 12pt; color: #000000;">[2] </span><a href="http://www.cnblogs.com/lidan/archive/2012/02/19/2357987.html"><span style="font-family: Arial; font-size: 12pt; color: #000000;">effective c++条款50：</span></a><a style="color: #222222; text-decoration: none; " href="http://www.cnblogs.com/lidan/archive/2012/02/19/2357987.html"><span style="font-family: Arial; font-size: 12pt; color: #000000;">了解new和delete的合理替换时机</span></a></span></h1></div>
<div><span style="font-family: Arial; font-size: 12pt">[3] <a href="http://wutiam.net/2011/10/game-engine-design-memory-management-framework/"><span style="font-family: Arial; font-size: 12pt">游戏引擎中的内存分配策略</span></a></span><br />[4] <a href="http://wangkaisino.blog.163.com/blog/static/1870444202011431112323846/">更好的内存管理jemalloc</a><br />[5] <a href="http://code.google.com/p/gperftools/?redir=1">tcmalloc官网(gperftools)</a></div></div><img src ="http://www.cppblog.com/daly88/aggbug/181131.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/daly88/" target="_blank">Daly</a> 2012-07-02 13:01 <a href="http://www.cppblog.com/daly88/archive/2012/07/02/181131.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Nginx源码学习(2) ---- 模块化及配置</title><link>http://www.cppblog.com/daly88/archive/2010/06/18/118175.html</link><dc:creator>Daly</dc:creator><author>Daly</author><pubDate>Fri, 18 Jun 2010 08:15:00 GMT</pubDate><guid>http://www.cppblog.com/daly88/archive/2010/06/18/118175.html</guid><wfw:comment>http://www.cppblog.com/daly88/comments/118175.html</wfw:comment><comments>http://www.cppblog.com/daly88/archive/2010/06/18/118175.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/daly88/comments/commentRss/118175.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/daly88/services/trackbacks/118175.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;&nbsp;<a href='http://www.cppblog.com/daly88/archive/2010/06/18/118175.html'>阅读全文</a><img src ="http://www.cppblog.com/daly88/aggbug/118175.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/daly88/" target="_blank">Daly</a> 2010-06-18 16:15 <a href="http://www.cppblog.com/daly88/archive/2010/06/18/118175.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>资源和内存管理学习总结</title><link>http://www.cppblog.com/daly88/archive/2010/05/02/114150.html</link><dc:creator>Daly</dc:creator><author>Daly</author><pubDate>Sat, 01 May 2010 16:02:00 GMT</pubDate><guid>http://www.cppblog.com/daly88/archive/2010/05/02/114150.html</guid><wfw:comment>http://www.cppblog.com/daly88/comments/114150.html</wfw:comment><comments>http://www.cppblog.com/daly88/archive/2010/05/02/114150.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/daly88/comments/commentRss/114150.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/daly88/services/trackbacks/114150.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要:   总结了几种资源和内存管理的实现思路。包括buddy算法，STL中的allocator实现思路，游戏中的资源管理&nbsp;&nbsp;<a href='http://www.cppblog.com/daly88/archive/2010/05/02/114150.html'>阅读全文</a><img src ="http://www.cppblog.com/daly88/aggbug/114150.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/daly88/" target="_blank">Daly</a> 2010-05-02 00:02 <a href="http://www.cppblog.com/daly88/archive/2010/05/02/114150.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>闲话STL与数据结构实现</title><link>http://www.cppblog.com/daly88/archive/2009/11/15/100971.html</link><dc:creator>Daly</dc:creator><author>Daly</author><pubDate>Sun, 15 Nov 2009 05:40:00 GMT</pubDate><guid>http://www.cppblog.com/daly88/archive/2009/11/15/100971.html</guid><wfw:comment>http://www.cppblog.com/daly88/comments/100971.html</wfw:comment><comments>http://www.cppblog.com/daly88/archive/2009/11/15/100971.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/daly88/comments/commentRss/100971.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/daly88/services/trackbacks/100971.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要:     关于STL与自己实现数据结构的讨论，以及在C中实现类型无关数据结构的编程技巧。&nbsp;&nbsp;<a href='http://www.cppblog.com/daly88/archive/2009/11/15/100971.html'>阅读全文</a><img src ="http://www.cppblog.com/daly88/aggbug/100971.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/daly88/" target="_blank">Daly</a> 2009-11-15 13:40 <a href="http://www.cppblog.com/daly88/archive/2009/11/15/100971.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>