Welcome to the Wolfire Blog! This is where we keep everyone up to date on our progress on Overgrowth and other new stuff. Be sure to subscribe to get the latest news! Also, be sure to check out the forums for even more up to date news - or get on IRC for up to the second updates.

Always initialize your memory

Add Comment! By Jeffrey Rosen on April 26th, 2009

I ran into an interesting bug when I was messing with an early version of David's shadows. I was a little surprised to see my full name projected onto the ground:

Unitialized memory screenshot
My name inscribed in the terrain

I often hear that you should always initialize your memory before using it, but I had never seen such a vivid example of what happens when you don't! Mac OS X draws the screen using OpenGL, so if you use uninitialized VRAM as a texture, you can accidentally load discarded images from earlier computer use.

Here are a few more screenshots:

Unitialized memory screenshot
Unitialized memory screenshot

So, try not to display raw allocated memory to the user. :) You never know what might be in there.