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, 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. Max - 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