Leaving Unused Fields in DMA Structures Uninitialized


What is it:

Leaving DMA pointers as garbage or nonsense.

The most common occurrence of this phenomenon is leaving the ccb_NextPtr field uninitialized. Future versions of the cel engine hardware may attempt to do pre-fetches to increase rendering speed; an uninitialized pointer pointing out of memory space could cause your process to terminate unexpectedly.

Why it's bad:

Hardware prefetch logic could cause your program to terminate.

What to do

Always initialize your structures. Always set DMA pointers to valid memory or to NULL.