ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev_epoll.c
(Generate patch)

Comparing libev/ev_epoll.c (file contents):
Revision 1.8 by root, Thu Nov 1 11:11:22 2007 UTC vs.
Revision 1.10 by root, Fri Nov 2 11:02:23 2007 UTC

1/* 1/*
2 * libev epoll fd activity backend
3 *
2 * Copyright (c) 2007 Marc Alexander Lehmann <libev@schmorp.de> 4 * Copyright (c) 2007 Marc Alexander Lehmann <libev@schmorp.de>
3 * All rights reserved. 5 * All rights reserved.
4 * 6 *
5 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 8 * modification, are permitted provided that the following conditions are
77 (events [i].events & (EPOLLOUT | EPOLLERR | EPOLLHUP) ? EV_WRITE : 0) 79 (events [i].events & (EPOLLOUT | EPOLLERR | EPOLLHUP) ? EV_WRITE : 0)
78 | (events [i].events & (EPOLLIN | EPOLLERR | EPOLLHUP) ? EV_READ : 0) 80 | (events [i].events & (EPOLLIN | EPOLLERR | EPOLLHUP) ? EV_READ : 0)
79 ); 81 );
80 82
81 /* if the receive array was full, increase its size */ 83 /* if the receive array was full, increase its size */
82 if (eventcnt == eventmax) 84 if (expect_false (eventcnt == eventmax))
83 { 85 {
84 free (events); 86 free (events);
85 eventmax += eventmax >> 1; 87 eventmax = array_roundsize (events, eventmax << 1);
86 events = malloc (sizeof (struct epoll_event) * eventmax); 88 events = malloc (sizeof (struct epoll_event) * eventmax);
87 } 89 }
88} 90}
89 91
90static void 92static void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines