bogotune broken? Larger data* revision committed to CVS.

Matthias Andree matthias.andree at gmx.de
Mon Nov 22 01:52:41 CET 2004


David Relson <relson at osagesoftware.com> writes:

> The following works (although the compiler complains about the
> externs).

That's probably not for the earlier ANSI-C (C89) compilers.

> .  It limits knowledge of the variable and gives the appearance of
> accessors without any speed penalty.  However, it really isn't very
> useful :-<

Speed isn't our concern except in loops that are executed often, and
there we can usually cache the variable. It's really the global variable
that is an issue.

For instance, we might store all the stuff that is read from the
configuration in a struct and pass a pointer to that struct, rather than
checking globals. It may not make a huge difference at first, and I'm
not urging towards an immediate complete replacement of globals, but it
becomes easier as we start splitting things up that used to be a single
unique resource per process, for instance, the environment.

>> True. We aren't getting anywhere as we have different opinions on
>> that, so I'm willing to go whatever we have. I'll need to try what
>> happens if I steal emacs the GNU ctags and give it Darren Hiebert's
>> Exuberant Ctags instead.
>
> I've been using etags (a little) and haven't noticed problems.  Years
> ago, I used to be a big tags user, but have fallen out of the habit..

Exuberant ctags works better. I've killed GNU ctags for now.

>> Poor man's exceptions are called setjmp ("try/catch" in one) and
>> longjmp("throw") and the sig* variants. They're even ANSI-C which has
>> been around for 15 years so there'll be no excuse if some system
>> doesn't have these. :-)
>
> I considered them, but shied away...

I've occasionally used setjmp/longjmp as well as sigsetjmp/siglongjmp
(for signal handlers) and it's always worked for me. We could use these
if the _exit in db_lock.c is too hard.

> I've got code with a wordlists open/closed flag and a test in bf_exit().
>  "make check" indicates bf_exit() isn't needed.

Make check isn't complete, but we don't have 100% test coverage at any rate.

> P.S. I'll add '-x' support to bogotune.  If recollection serves, it only
> takes a line or two of code.

Thanks a bunch.

-- 
Matthias Andree



More information about the bogofilter-dev mailing list