[Asterisk-Dev] locate parking lot in res_features.c ?
Luigi Rizzo
rizzo at icir.org
Wed Jan 4 12:35:40 MST 2006
On Wed, Jan 04, 2006 at 08:30:44PM +0100, Olle E Johansson wrote:
> Luigi Rizzo wrote:
> > The following uncommented code in res_features.c::ast_park_call()
> > is extremely expensive because it has O(N*M) cost, where N is the
> > size of the parking lot, and M is the number of parked calls:
> >
> > for (i = 0; i < parking_range; i++) {
> > x = (i + parking_offset) % parking_range + parking_start;
> > for (cur = parkinglot; cur; cur = cur->next)
> > if (cur->parkingnum == x)
> > break;
> > if (!cur) /* extension x is free, take it */
> > break;
> > }
> >
> Luigi,
> Please check out my multiparking branch and let's try some new approach
i did look at that, you seem to be using the same code.
However beyond the actual implementation, i would like to know
what is the desired result. I am just guessing from the actual
code, but have no idea if that is exactly the goal.
cheers
luigi
> within that code. I'll happily accept patches to that, since that
> changes parking and might as well fix this issue as well.
> /O
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> Asterisk-Dev mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-dev
More information about the asterisk-dev
mailing list