[KinoSearch] DEBUG() and ASSERT()
Nathan Kurz
nate at verse.com
Mon Oct 15 19:13:05 PDT 2007
On 10/15/07, Marvin Humphrey <marvin at rectangular.com> wrote:
> OK, I've finished integrating/implementing this. The guts are
> somewhat different, but for the most part the API is the same and you
> are going to be able to use it as you are accustomed to. Here are
> some the changes that were made which are visible from the outside:
All looks good to me at a cursory viewing. Well done on making it
conform to the KinoSearch standard while keeping the API. I vaguely
recall that there was some reason I had used multiple static functions
defined in the Debug.h file, but for this project what you did seems
better.
> > It's a little tricky to integrate this system with the XS loader and
> > builder. I've done it before by creating a Makefile that creates both
> > a normal and debug version and changes the XS bootstrap function to
> > use libfoo.so or libfoo_debug.so according to the DEBUG environment
> > variable.
>
> It'd be pretty killer to get this happening. My initial thought is
> that it would be better to load the debug version of the shared
> library via a "use" directive than an environment variable, since %
> ENV is tainted.
>
> use KinoSearch 'DEBUG';
I think the advantage of relying on an environment variable is that
you can use the same executable for debug and live on a server.
Editing the script to comment it in/out is clumsy, making a copy with
one line different seems messy. But what you suggest is a fine
solution for the present.
> I don't suppose we could get full C stack traces happenin', could we?
Not sure if I understand where you want this. For a
die_with_stacktrace() function that could be called from the C
library? Seems possible, if we don't mind that it is gcc specific.
Nathan Kurz
nate at verse.com
_______________________________________________
KinoSearch mailing list
KinoSearch at rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch
More information about the kinosearch
mailing list