On Dec 22, 2007, at 10:31 AM, Marc Lehmann wrote:

>> 1. Only instantiate the have_monotonic variable #if EV_USE_MONOTONIC
>> (have_monotonic's usage seems to be protected by EV_USE_MONOTONIC)
>>
>> 2. Only declare infy_fork() #if EV_USE_INOTIFY (infy_fork()'s
>> definition is surrounded by #if EV_USE_INOTIFY)
>
> I think these changes increase maintainance burden too much without
> providing any real benefit. Not having have_monotonic is an  
> exceptional
> case, and having to maintain #ifdef logic for it probably creates more
> problems than it solves.

2 "FWIW" points:

1. Not having have_monotonic is the default on OS X / Leopard (see  
below)
2. #if's for EV_USE_MONOTONIC and EV_USE_INOTIFY already protect all  
the usage of have_monotonic and inotify, respectively

>> static struct ev_loop *
>> ev_default_loop (unsigned int flags) { ... }
>>
>> Should that function be marked as inline?
>
> No, because inline semantics are not portable at the moment (C99 vs.  
> gcc),
> so static is the closest equivalent.

Also FWIW: AC_C_INLINE can take of this for you -- here's its  
description:

-----
If the C compiler supports the keyword inline, do nothing. Otherwise  
define inline to __inline__ or __inline if it accepts one of those,  
otherwise define inline to be empty.
-----

>> That might result in a slight speedup on some platforms if the  
>> function
>> is actually inlined.
>
> Only if it wouldn't get inlined already, which it will be in most
> cases. Have you actually looked? It would be interesting to know which
> compiler doesn't inline it under whcih conditions (obviously, gcc  
> without
> optimisation won't).

Nope; I didn't check.

> libev has been checked for relevant compiler warnings (on the  
> platforms
> and with the compilers I use only of course).

Fair enough.  Is OS X one of those platforms?  (I couldn't find an  
official list of supported platforms -- did I miss it?)

A related (but probably random) question: are there any correctness  
tests for libev?  I already run a boatload of regression tests for my  
own stuff every night in an automated test harness; I'd be happy to  
add libev (standalone; outside of the other stuff I test) to the mix  
with a variety of platforms and compilers if it would be helpful.

-- 
Jeff Squyres
Cisco Systems

_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to