Hacker News new | past | comments | ask | show | jobs | submit login
Random Values in Pointers (philpearl.github.io)
35 points by karagenit 5 months ago | hide | past | favorite | 2 comments



putting bad values into pointer variables in gc'd languages is arguably worse than doing so in non-gc'd ones. i'd say that gc'd languages should prevent you from doing it.


A while ago, I was using an emulator for a 32-bit processor I was writing code for. To detect access of non-initialized storage, instead of having an out-of-band bit for each word, it stored hex deadbeef in each word before program start and, at each memory read, checked for this. If it was found, the enulator halted with an error.

This was very handy in catching errors. I never saw this particular word actually generated, so it never indicated a false error.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: