Added individual subset selection using the mouse and extended list box. The interface is turning out really nice. Next I'll need to clean up and reorganize my modules cuz things are starting to get a little out of control [smile].
🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Spent most of my day tracking down an obscure bug in my material editor. It was appearing to crash at random. Cause: There was corrupt data at a memory address. Turned out that I was accessing a dynamic array with a -1 index every once in a while and this corrupted the pointer so that when I went to delete [] the array the app crashed. Glad that's over. Thanks to the good old OutputDebugString().
Added individual subset selection using the mouse and extended list box. The interface is turning out really nice. Next I'll need to clean up and reorganize my modules cuz things are starting to get a little out of control [smile].
Added individual subset selection using the mouse and extended list box. The interface is turning out really nice. Next I'll need to clean up and reorganize my modules cuz things are starting to get a little out of control [smile].
Previous Entry
An Old Game
Next Entry
Reforming my Ego
Comments
February 04, 2005 06:57 PM
Thanks Coder!
edit: So are you saying that we shouldn't use dynamic arrays? Or just that we should use some sort of container if we do?
edit2: Yes I now see using _ASSERTE with _CrtCheckMemory() will be very usefull for apps made with VC++! [smile]
edit: So are you saying that we shouldn't use dynamic arrays? Or just that we should use some sort of container if we do?
edit2: Yes I now see using _ASSERTE with _CrtCheckMemory() will be very usefull for apps made with VC++! [smile]
February 04, 2005 08:25 PM
Quote: edit: So are you saying that we shouldn't use dynamic arrays? Or just that we should use some sort of container if we do?
Basically, in C++, you should almost always use std::vector instead of raw arrays. And always use std::vector::at() to access elements, because it does bounds-checking. If profiling shows std::vector::at() is a bottleneck somewhere (in some oft-used inner-loop), switch to std::vector::operator[](), which simply generates code equivalent to what would have been generated with direct access to the raw array (i.e. no performance hit).
Bjarne - The Man (TM) - says it all. Read everything the guy has to say [smile]
Quote: edit2: Yes I now see using _ASSERTE with _CrtCheckMemory() will be very usefull for apps made with VC++!
You can also make use of _CrtSetDbgFlag for memory-leak tracking - it makes it a breeze (plug "Detecting and Isolating Memory Leaks Using Microsoft Visual C++" into google and read the MSDN article that comes up [smile])
February 04, 2005 10:28 PM
Or instead of _CrtCheckMemory, I use Paul Nettles' mmgr, probably does very much the same thing though. It certainly helped me find some very obscure bugs.
February 05, 2005 04:49 AM
Advertisement
Latest Entries
OpenGL Indexed Geometry Buffer
1813 views
Cult of Gameplay
1377 views
Cross Platform Is Working
1465 views
Start up the engine
1413 views
Gathering some art
1337 views
Making a game
1286 views
ImageMagick Magick++ to HBITMAP using C++
2562 views
Problems != Good Sleep
1292 views
Cylindrical Texture Mapping
1580 views
Daemon (novel)
1388 views
Advertisement
Also, scattering _CrtCheckMemory() calls throughout your code can quickly help you identify the source of heap corruption.
My 2 cents [smile]