I don't know for sure, but 0xdeadbeef is a common memory marker to check for things like memory overwrites and the like because it's easy to recognize (being the English words "dead beef") as well as valid hex. So my guess is they were afraid of memory overwrites so they pre-filled it with that marker. (It also looks like their MALLOC macro includes both malloc and memset... fun...)
As an aside, the reason "deadbeef" is chosen instead of just 0s is a lot of times memory is initialized with zeros anyway, so if you're looking for overwrites or corruption, you want to pick something else.
As to why they define COMPRESSMEM to it, that I have no idea...
Comments 3
So my guess is they were afraid of memory overwrites so they pre-filled it with that marker. (It also looks like their MALLOC macro includes both malloc and memset... fun...)
Reply
As to why they define COMPRESSMEM to it, that I have no idea...
Reply
I'm just hoping that a) this never gets used anywhere, and b) perhaps this is a magic number that causes MALLOC to perform an undocumented function.
Reply
Leave a comment