[asterisk-dev] Help needed for main/pbx.c

Stefan Schmidt sst at sil.at
Tue Nov 2 16:50:43 CDT 2010


hello,

i have finished the first part of my statechange patch and i have a
question about the right way / place to bring it in.

by now i have added one container for devices which are used in hints so
there is no iteration through the whole hint link list, just a hash
compare to the device (which we allready know) and a direct link to the
hint which includes this device.
the values i can see by now are just great but i have one problem.

for example in chan_sip.c there is a load and unload module function
where i can allocate and clean up a container but there is nothing in
pbx.c like this. i have just written a function which checks if the
container is allocated and if not, just allocate it if needed.
But i dont have an idea where i should clean this up in pbx.c, so my
patch would cause a memory leak.

any ideas where i can build this in?



the next part of this patch would be the switch from a linklist for
hints to a real container but the performance improvment for
handlestatechange is nearly 85 times faster by now:

handle_statechange called: 28008 overalltime: 16791 ms (orig trunk)
handle_statechange called: 27952 overalltime: 200 ms (patched trunk)

thanks for your help!

best regards

stefan



More information about the asterisk-dev mailing list