Visual c++ 有人能在win ce 6.0中粘贴检测内存泄漏的代码吗?

Visual c++ 有人能在win ce 6.0中粘贴检测内存泄漏的代码吗?,visual-c++,windows-ce,Visual C++,Windows Ce,嘿,我需要检测win ce内存泄漏的代码。我使用Visual C++。谁能给我一个吗 void *my_debug_malloc(size_t size) { void *p = malloc(size); printf("malloced %d bytes at %08X\n", size, p); return p; } void my_debug_free(void *p) { printf("About to free ? bytes at %08X\n", p);

嘿,我需要检测win ce内存泄漏的代码。我使用Visual C++。谁能给我一个吗

void *my_debug_malloc(size_t size) { void *p = malloc(size); printf("malloced %d bytes at %08X\n", size, p); return p; } void my_debug_free(void *p) { printf("About to free ? bytes at %08X\n", p); free(p); } #define malloc my_debug_malloc #define free my_debug_free // The rest of your program... void*my\u debug\u malloc(大小) { void*p=malloc(尺寸); printf(“在%08X\n处的malloced%d字节”,大小,p); 返回p; } void my_debug_free(void*p) { printf(“即将释放?字节在%08X\n”,p); 自由基(p); } #定义malloc my_debug_malloc #定义自由我的调试自由 //你程序的其余部分。。。 calloc,realloc留作练习:)

实际上,我已经用这个方法调试了很多代码。但后来我们买进了,生产力提高了……

  • 您可以查看Sue Loe关于Windows CE内存工具的博客:
  • 以下是Windows CE 6应用程序验证程序的参考:
  • 下面是关于Douglas Boing的应用程序验证程序5。如果我没有弄错的话,它的大部分内容也应该与WindowsCE6相关
  • 要获取应用程序验证程序,您需要下载Windows CE 6(Platform Builder 6)。免费6个月:

没有人会为此向您提供代码。请尝试在谷歌中搜索可以为您实现这一点的工具。谢谢您的回复。我有勇气。但我的客户需要检测memoryleak的代码。我在我的交付日期,所以我要求代码,大多数C库都有内置的堆检查器,它们只能对不一致性发出警告,例如双重释放、无效释放等,但不会捕获缓冲区溢出。通过标记检测内存泄漏。例如,标记堆、运行请求/程序流、监视未释放的对象。