Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
bad habits come back to bite you
#1
I have a very bad habit... when defining classes in C++ I often just put the label and type... This is usually ok, since I seldom write release builds.

The reason there's a difference is that in debug builds the compiler usually nulls all variables and clears memory to 0..release builds don't, memory is as it is when it fires up.

Usually.

I discovered the compiler on the Arm64 Jetson doesn't.......

And it took me 6 hours to work out why, in a demo I was workig on that worked perfectly on 8 other machines, only the Jetson redused to display the 1st of 4 test models........


I had not 0'd a rotation Vec3, and in the update of the model I was rotating assuming 0.....


Bad habits only get broken when you make bad mistakes.... 6 hours though...ooooff.. I should know better.

I have now put default values in all class varibles in the class define.
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's 



Reply


Messages In This Thread
bad habits come back to bite you - by Brian Beuken - 12-06-2020, 02:52 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)