Changeset 34989
- Timestamp:
- 08/23/09 21:30:26 (4 years ago)
- Files:
-
- 1 modified
-
lang/c/picoev/trunk/picoev.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/c/picoev/trunk/picoev.h
r34988 r34989 17 17 #define PICOEV_IS_INITED (picoev.max_fd != 0) 18 18 #define PICOEV_IS_INITED_AND_FD_IN_RANGE(fd) ((fd) < picoev.max_fd) 19 #define PICOEV_NO_MEMORY(p) ((p) != NULL)20 19 #define PICOEV_TOO_MANY_LOOPS (picoev.num_loops != 0) /* use after ++ */ 21 20 #define PICOEV_FD_BELONGS_TO_LOOP(loop, fd) \ … … 79 78 /* initializes picoev */ 80 79 PICOEV_INLINE 81 voidpicoev_init(int max_fd) {80 int picoev_init(int max_fd) { 82 81 assert(! PICOEV_IS_INITED); 83 82 assert(max_fd > 0); 84 picoev.fds = (picoev_fd*)valloc(sizeof(picoev_fd) * max_fd); 85 assert(PICOEV_NO_MEMORY(picoev.fds)); 83 if ((picoev.fds = (picoev_fd*)valloc(sizeof(picoev_fd) * max_fd)) == NULL) { 84 return -1; 85 } 86 86 picoev.max_fd = max_fd; 87 87 picoev.num_loops = 0; … … 91 91 = PICOEV_RND_UP(picoev.timeout_vec_size, PICOEV_SIMD_BITS) 92 92 / PICOEV_LONG_BITS; 93 return 0; 93 94 } 94 95
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)