On Thu, Jul 08, 2004 at 12:04:48AM -0700, Justin Erenkrantz wrote: > --On Wednesday, July 7, 2004 7:40 AM +0000 [EMAIL PROTECTED] wrote: > > >jorton 2004/07/07 00:40:12 > > > > Modified: poll/unix poll.c > > . configure.in > > Log: > > * poll/unix/poll.c (backend_cleanup): Only define if using epoll/kqueue. > > (apr_pollset_destroy): Only run cleanup if using epoll/kqueue. > > (apr_pollset_add): Fix warning for ye olde platforms still using poll(). > > I changed this from Paul's patch on purpose. Why shouldn't we always > define the cleanup even if we don't have kqueue or epoll?
Since we know the cleanup does nothing, defining it unnecessarily wastes both a few bytes of code size and a few cycles at run-time. e.g. since the cleanup is never registered for the non-epoll/kqueue case, running apr_pool_cleanup_destroy() will iterate over the whole cleanup list looking for it if apr_poll_destroy() is called. > If we add Solaris's /dev/poll, we'd need a cleanup. I see only the > fallback implementation perhaps not needing it - almost any real > implementation would. I thought doing it your way makes the code a > lot less clean. The "unreal?" poll/select implementations will be used on the majority of APR platforms and do *not* currently require a cleanup, no "perhaps" about it. This is just a minor optimisation with minor cleanliness cost for the majority of platforms, I don't think it's a big deal. joe