开发者

How do I use "scribbling" to detect mods to free blocks?

开发者 https://www.devze.com 2023-03-09 14:37 出处:网络
I\'m trying to figure out what\'s corrupting my heap; I\'m sure you envy me and my predicament. SO tells me that I can turn on \"Scribble\" to write 0xAA into allocs and 0x55 into deallocs, to help m

I'm trying to figure out what's corrupting my heap; I'm sure you envy me and my predicament.

SO tells me that I can turn on "Scribble" to write 0xAA into allocs and 0x55 into deallocs, to help me figure out where things are going wrong.

Only thing is, I've got no clue where/how to make good use of this. What do I use this for?

(Bonus: I'm curious about why those values, specifically, are used...)

开发者_StackOverflow社区

I'm coding C/C++ in Xcode using openFrameworks and the Vamp psychoacoustic-labeling library, for what it's worth, but I think my question is more general than that.


  1. run 'man Guard_Malloc' or 'man libgmalloc' and read about the debugging options.

  2. see valgrind, perhaps starting from http://valgrind.org/downloads/current.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号