okay, people always say things like yeah, you can be much more efficient in C/C++ than on other languages.
that statement is VERY TRUE, but even more deceptive, because if you dont know how to properly mannage
you memory you will be fucked.
the first is an example of good memory management.
notice the free(a) inside the loop.
exhibit A:
this is an example of poor management, the free is non exsistant. this causes you to assign new memory everytime, and the old memory stays locked and unusable. the code also too 87.4 times as long to complete.
exhibit B:
if your code is slow and memory intensive. allways remember that evil hids in loops!.
Memory Performance in Games.
Moderator: Coders of Rage
Memory Performance in Games.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
Dad, "Yea well I have a fan belt in street fighting"
Re: Memory Performance in Games.
Nice and clear example.