I can’t figure out if I’m screwing up in some terrible way or if the compiler really is at fault here. I have 2 spots in my code, both related to loading files, that will not work in Release mode – only in Debug. In Release, they both randomly crash with some sort of s_zone error (memory related, I believe). I can fix this by wrapping the offending areas of code in pragma statements, like this:
#pragma optimization_level 0
...offending code here...
#pragma optimization_level reset
This allows me to turn off optimizations on just the section of code that is crashing and this does seem to fix it. However, I’m not 100% convinced that my code isn’t at fault in some way. It’s hard to stomach the idea that the compiler is doing something wrong – however, I’ll be damned if I can see why or what in my code is causing the issue.
Ahh well…
Tags: ToeTag
[...] optimizations for two pieces of code and I didn’t understand why? Of course you do, it was here, remember? Well, I was listening to the latest episode of Late Night Cocoa wherein they were [...]