Edit: Disregard this post I had messed up the DEBUG_BEGIN_DATA_BLOCK function/define.

My copy(handwritten) of the code kept crashing in the default case,

in function the function "CollateDebugRecords" in the switch(Event->Type) the default case

I surrounded the content of the case with a if(Thread->FirstOpenDataBlock) to stop it crashing, I couldn't find a case where FirstOpenDataBlock was initialized to all Zeros so I find it strange that Casey's code isn't crashing, but I believe it has happened before that his code ran with memory initialized in a way that hid the bug.

Any idea why I needed to do this?

Should Thread in this case be Frame maybe, is the code initializing the FirstOpenDataBlock on one thread and looking for it on every Thread?


Visual Studio would also (one out of ten times)show this error as a Access violation on the line


GlobalDebugTable = Game.DEBUGGameFrameEnd(&GameMemory, NewInput, &Buffer);


in the Win32 Layer.