[C++] 检查随机内存溢出

C++程序的随机内存溢出是非常难处理的,windows提供了一些工具来缓解这个问题。

windows debuger提供的Global Flags可以设置“enable heap tail checking”,设置之后,每块heap内存的尾巴上都会加上check bytes;当free的时候会检查check bytes是否改变,如果改变了就报警。

类似的还有几个选项:

Enable heap free checking

Enable heap validation on call

Enable heap tagging


posted on 2014-04-09 14:08  如果蜗牛有爱情  阅读(307)  评论(0编辑  收藏  举报

导航