Eggheads: Aaaargh

stdarg stdarg at
Sat Aug 16 22:10:45 CST 2003

--- Paul <PaulE at> wrote:
> >From the looks of things though, it is possible to tell a 'builtin' bind
> from a tcl bind, thus it would be possible to create two codepaths, thus
> adding a little bit more speed.

The approach taken in 1.7 is the opposite of now. All the binds are C
functions, and some C functions are stubs that call the appropriate tcl
function (provided by the tcl module).

> I guessing this would break the tcl-C bridge mind, which not really
> being a tcl programmer I suppose isnt my first priority.... Mind you, if
> it aint broke, then why fix it... You need any more programmers at the
> moment? Lol

Yeah, it would be pretty messy to change in 1.6. Timers are the same way.

We do need more programmers, especially on the 1.7 project :)

Not only more programmers, but some input on how things should be done. We want
to make 1.7 very friendly and easy to write scripts/modules for. For instance,
instead of all that code for setting an XTRA key, you can just say:

user_set_setting(user, "channel or NULL for globals", "settingname", value);

> static void SetXtra(char * pHand, char * pField, char * pData)
> {
> }
> However, I find if you unload the mod I start getting memory leaks in
> the main bot, and inevitable crashes. Presumably this has something to
> do with the main bot thinking the memory is still allocated when it has
> in fact been freed... But then that's what I thought user_malloc was
> for...
> Am I going about this the wrong way, or is this just something I'm gonna
> have to live with?

I've never used XTRA from a module, so I'm not sure, but looking at the code,
maybe the problem comes up when you're deleting it? To delete it, you have to
call user_set again with pXtraKey->data = NULL. Then the xtra_set() function in
the core will free the old data.

Your code for setting the data seems fine. Have you looked at core dumps to see
exactly what is crashing?

> P.

Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

More information about the Eggheads mailing list