Eggheads: Aaaargh

Paul PaulE at Blueyonder.co.uk
Sun Aug 17 05:19:44 CST 2003


I have looked at the core a little bit, I'm only just getting the hang
of gdb tbh :/ When I've tracked that one a little more I will get back
to you :)

I would certainly be more than happy to contribute any time I can (job
providing and all that) to the eggdrop project and 1.7 sounds very
interesting - maybes we had better continue this in pm!

-----Original Message-----
From: eggheads-bounces at eggheads.org
[mailto:eggheads-bounces at eggheads.org] On Behalf Of stdarg
Sent: 17 August 2003 05:11
To: Eggdrop Discussion List
Subject: RE: Eggheads: Aaaargh



--- Paul <PaulE at Blueyonder.co.uk> 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
http://sitebuilder.yahoo.com



More information about the Eggheads mailing list