[Asterisk-Dev] locate parking lot in res_features.c ?

Olle E Johansson oej at edvina.net
Wed Jan 4 12:30:44 MST 2006


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 
within that code. I'll happily accept patches to that, since that 
changes parking and might as well fix this issue as well.

/O



More information about the asterisk-dev mailing list