Re: [conntrack-utils PATCH r7285 04/11] added alarm_pending()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Max Kellermann wrote:
> On 2008/01/23 12:50, Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote:
>> Max Kellermann wrote:
>>> +int alarm_pending(struct alarm_list *alarm, struct timeval *tv)
>>> +{
>>> +	if (list_empty(&alarm->head))
>>> +		return 0;
>>> +
>>> +	if (tv != NULL)
>>> +		*tv = alarm->tv;
>> This introduces an extra copy.
> 
> I know.  This patch should make transition to libevent smooth.
> libevent still has this copy in evtimer_pending() but it is called
> rarely

I have noticed it during the first loop review.

> and libevent does not do a lookup in 2048 lists in every main
> loop iteration.
>>> +	if (!alarm_pending(alarm, &tmp))
>>> +		return 0;
>> I cannot think of a situation where alarm_pending returns true at the
>> moment.
> 
> You mean, where alarm_pending returns false?  The check is just here
> for completeness, you could replace it with an assertion.

Indeed. I like this extra checking for completeness. Applied without the
tv parameter.

-- 
"Los honestos son inadaptados sociales" -- Les Luthiers
-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux