Rockbox mail archive
Subject: Re: settings.c confuses me
From: TP Diffenbach (rockbox_at_diffenbach.org)
Date: 2003-03-24
How much code space do we use setting this up? It seems we have a /lot/ of repetitive code.
> The memory we
> waste using a bigger struct is saved by enabling simpler code to
> access the data.
Quoting Björn Stenberg <bjorn_at_haxx.se>:
> TP Diffenbach wrote:
> > Why not just read the settings on disk into global settings:
> > read( fd, &global_settings, sizeof( global_settings)?, with some
> additional
> > code for the RTC?
>
> The config block is packed into 512 bytes, while the
> global_settings struct is unpacked and thus bigger. The memory we
> waste using a bigger struct is saved by enabling simpler code to
> access the data. (Booleans as ints instead of bits, for example.)
>
> --
> Björn
>
--
Archos FM needs a Rockbox!
Page was last modified "Jan 10 2012" The Rockbox Crew
|