导航

2012年2月19日

摘要: Managing Memory EfficientlyWhen it comes to view controllers and memory management, there are two issues to consider: How do you allocate memory efficiently?When and how do you release memory? Although some aspects of memory allocation are strictly yours to decide, there are a handful of methods in 阅读全文

posted @ 2012-02-19 23:33 残影无伤 阅读(196) 评论(0) 推荐(0)

摘要: 最近在笔试时遇到一个问题:C++中内存泄露比较难以检测,如不严加防范很容易出现严重的问题。请设计一套方案来帮助检测C++程序中的内存泄露问题。1. 如果只检测对象的内存泄露该如何做?2. 如果要检查程序中全部的内存泄露如何做? 自己做了以下实验:#define_CRTDBG_MAP_ALLOC#include<crtdbg.h>#include<stdlib.h>#include<iostream>#include<assert.h>#ifdef_DEBUG#defineDEBUG_CLIENTBLOCKnew(_CLIENT_BLOCK,__F 阅读全文

posted @ 2012-02-19 22:14 残影无伤 阅读(1685) 评论(0) 推荐(1)