X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/1b109e5d8b0948a2e7151b3820f1c4784cafeece..aa3db4d9af85499b82ea83235a1400f24a2965c8:/ev_epoll.c diff --git a/ev_epoll.c b/ev_epoll.c index f0a9678..4793212 100644 --- a/ev_epoll.c +++ b/ev_epoll.c @@ -1,4 +1,6 @@ /* + * libev epoll fd activity backend + * * Copyright (c) 2007 Marc Alexander Lehmann * All rights reserved. * @@ -79,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); } }