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

Comparing libev/ev.c (file contents):
Revision 1.493 by root, Sun Jun 23 02:02:24 2019 UTC vs.
Revision 1.495 by root, Mon Jun 24 21:27:57 2019 UTC

438# endif 438# endif
439#endif 439#endif
440 440
441#if EV_USE_LINUXAIO 441#if EV_USE_LINUXAIO
442# include <sys/syscall.h> 442# include <sys/syscall.h>
443# if !SYS_io_getevents || !EV_USE_EPOLL 443# if !SYS_io_getevents || !EV_USE_EPOLL /* ev_linxaio uses ev_poll.c:ev_epoll_create */
444# undef EV_USE_LINUXAIO 444# undef EV_USE_LINUXAIO
445# define EV_USE_LINUXAIO 0 445# define EV_USE_LINUXAIO 0
446# endif 446# endif
447#endif 447#endif
448 448
1989{ 1989{
1990 *cur = array_nextsize (elem, *cur, cnt); 1990 *cur = array_nextsize (elem, *cur, cnt);
1991 return ev_realloc (base, elem * *cur); 1991 return ev_realloc (base, elem * *cur);
1992} 1992}
1993 1993
1994#define array_needsize_noinit(base,count) 1994#define array_needsize_noinit(base,offset,count)
1995 1995
1996#define array_needsize_zerofill(base,count) \ 1996#define array_needsize_zerofill(base,offset,count) \
1997 memset ((void *)(base), 0, sizeof (*(base)) * (count)) 1997 memset ((void *)(base + offset), 0, sizeof (*(base)) * (count))
1998 1998
1999#define array_needsize(type,base,cur,cnt,init) \ 1999#define array_needsize(type,base,cur,cnt,init) \
2000 if (expect_false ((cnt) > (cur))) \ 2000 if (expect_false ((cnt) > (cur))) \
2001 { \ 2001 { \
2002 ecb_unused int ocur_ = (cur); \ 2002 ecb_unused int ocur_ = (cur); \
2003 (base) = (type *)array_realloc \ 2003 (base) = (type *)array_realloc \
2004 (sizeof (type), (base), &(cur), (cnt)); \ 2004 (sizeof (type), (base), &(cur), (cnt)); \
2005 init ((base) + (ocur_), (cur) - ocur_); \ 2005 init ((base), ocur_, ((cur) - ocur_)); \
2006 } 2006 }
2007 2007
2008#if 0 2008#if 0
2009#define array_slim(type,stem) \ 2009#define array_slim(type,stem) \
2010 if (stem ## max < array_roundsize (stem ## cnt >> 2)) \ 2010 if (stem ## max < array_roundsize (stem ## cnt >> 2)) \
2807#ifdef __FreeBSD__ 2807#ifdef __FreeBSD__
2808 flags &= ~EVBACKEND_POLL; /* poll return value is unusable (http://forums.freebsd.org/archive/index.php/t-10270.html) */ 2808 flags &= ~EVBACKEND_POLL; /* poll return value is unusable (http://forums.freebsd.org/archive/index.php/t-10270.html) */
2809#endif 2809#endif
2810 2810
2811 /* TODO: linuxaio is very experimental */ 2811 /* TODO: linuxaio is very experimental */
2812#if !EV_RECOMMEND_LINUXAIO
2812 flags &= ~EVBACKEND_LINUXAIO; 2813 flags &= ~EVBACKEND_LINUXAIO;
2814#endif
2813 2815
2814 return flags; 2816 return flags;
2815} 2817}
2816 2818
2817ecb_cold 2819ecb_cold

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines