Rockbox.org home
releases
current build
extras FAQ
manual
wiki
docs index mailing lists
IRC
forums bugs
patches



Rockbox mail archive

Subject: arrays & pointers

arrays & pointers

From: BlueChip <cs_bluechip_at_webtribe.net>
Date: 2005-01-03

Just saw this go in...

Log Message:
using a pointer instead of array dereferencing saves ~250 bytes

 From my work on the card games library ...I discovered that arrays are
probably THE most expensive thing for our compiler. If you are going to
reference an element in array even just twice, it is memory efficient to
create a pointer to that element and use the pointer instead.

Given the _excessive_ efficiency of it, I guess it is also faster as well!

If you're going to access the pointer several times, you might even like to
stick a "register" in front of it for extra speed :)

BC

_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox
Received on Mon Jan 3 21:37:09 2005


Page was last modified "Mar 9 2008" The Rockbox Crew