[OPEN-ILS-DEV] PATCH: osrf_list.[ch] (miscellaneous)

Scott McKellar mck9 at swbell.net
Tue Jan 1 02:55:19 EST 2008


--- Mike Rylander <mrylander at gmail.com> wrote:

> On Dec 30, 2007 1:14 PM, Scott McKellar <mck9 at swbell.net> wrote:
> > These patches tidy up various things.
> >
> > 1. I moved the macros OSRF_LIST_DEFAULT_SIZE and OSRF_LIST_INC_SIZE
> > from the header into the implementation file.  No other source
> files
> > reference them, nor should they.
> >
> > 2. I moved the OSRF_LIST_MAX_SIZE macro into the implementation
> file
> > as well, and then commented it out.  It is nowhere referenced, but
> > out of caution I preserved it like a fly in amber.
> 
> I'm holding back this patch, and the similar parts of the patch to
> osrf_hash.[ch] until I can get a wee bit of feedback.
> 
> I wonder if what we want is a build-time-knobs.h to hold build-time
> tunable settings that we don't want to hard-code and for whatever
> reason we may want to tweak in the future (better cache-line
> alignment, different architectures, embedded environments, other
> stuff
> I'm not thinking of right now...).
> 
> Opinions?

I don't see a reason to collect tunable settings into a single
header file.  Leave them wherever they belong.  If you want to be
able to tune something at compile time, use conditional compilation:

#ifndef FOO
#define FOO 256
#endif

...and use the -D option to specify alternative values, as desired,
in the Makefile.

In principle this approach would enable us to use different values
for the same tunable setting in different executables.  For example
we might want to cache up to 50 jsonObjects for most executables, but
up to 20,000 for anything containing cstore.c.  I don't know how hard
it would be to build that kind of fine-grained control into the 
Makefiles.

Scott McKellar
http://home.swbell.net/mck9/ct/



More information about the Open-ils-dev mailing list