X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/34ce8134fec96758f92d4b5a47d151081c6b74d6..aa3db4d9af85499b82ea83235a1400f24a2965c8:/ev_epoll.c diff --git a/ev_epoll.c b/ev_epoll.c index 7614ac5..4793212 100644 --- a/ev_epoll.c +++ b/ev_epoll.c @@ -81,10 +81,10 @@ epoll_poll (ev_tstamp timeout) ); /* if the receive array was full, increase its size */ - if (eventcnt == eventmax) + if (expect_false (eventcnt == eventmax)) { free (events); - eventmax += eventmax >> 1; + eventmax = array_roundsize (events, eventmax << 1); events = malloc (sizeof (struct epoll_event) * eventmax); } }