Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#12136 - Save some binsize in tagtree.c

Attached to Project: Rockbox
Opened by Nils Wallménius (nls) - Sunday, 29 May 2011, 21:47 GMT+2
Last edited by Nils Wallménius (nls) - Tuesday, 31 May 2011, 21:45 GMT+2
Task Type Patches
Category Database
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Release 3.8.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

This patch replaces a macro for testing string equality used many times with loops over arrays of pointers. Saves about 700bytes on a cf build.
   tagtree_size.diff (6.2 KiB)
 apps/tagtree.c |  159 ++++++++++++++++++++++++++++++++-------------------------
 1 file changed, 91 insertions(+), 68 deletions(-)

This task depends upon

Closed by  Nils Wallménius (nls)
Tuesday, 31 May 2011, 21:45 GMT+2
Reason for closing:  Accepted
Additional comments about closing:  comitted
Comment by Andree Buschmann (Buschel) - Monday, 30 May 2011, 07:49 GMT+2
Saves ~1200 Byte on a nano 2G build.
Comment by amaury pouly (pamaury) - Monday, 30 May 2011, 09:28 GMT+2
Looks like a reasonable thing to do.
Comment by sideral (sideral) - Monday, 30 May 2011, 11:58 GMT+2
My initial testing looks good. I'll report back after some more testing in a couple of days.

Maybe you could save even more binsize by factoring out the loops as well (into a small utility function)?
Comment by Nils Wallménius (nls) - Tuesday, 31 May 2011, 16:23 GMT+2
Thanks for testing, i made a quick test with the matching loop broken out into a separate function but it made no significant change to size (12 bytes bigger on cf, same size on arm (gigabeast))
Comment by sideral (sideral) - Tuesday, 31 May 2011, 20:17 GMT+2
My testing over the last few days has not revealed any issues. I think you can commit this patch. Cheers!

Loading...