• Home
  • Raw
  • Download

Lines Matching refs:pop

104 poll_check_ok(struct pollop *pop)  in poll_check_ok()  argument
109 for (i = 0; i < pop->fd_count; ++i) { in poll_check_ok()
110 idx = pop->idxplus1_by_fd[i]-1; in poll_check_ok()
113 EVUTIL_ASSERT(pop->event_set[idx].fd == i); in poll_check_ok()
115 for (i = 0; i < pop->nfds; ++i) { in poll_check_ok()
116 struct pollfd *pfd = &pop->event_set[i]; in poll_check_ok()
117 EVUTIL_ASSERT(pop->idxplus1_by_fd[pfd->fd] == i+1); in poll_check_ok()
121 #define poll_check_ok(pop) argument
129 struct pollop *pop = base->evbase; in poll_dispatch() local
132 poll_check_ok(pop); in poll_dispatch()
134 nfds = pop->nfds; in poll_dispatch()
143 if (pop->realloc_copy) { in poll_dispatch()
144 struct pollfd *tmp = mm_realloc(pop->event_set_copy, in poll_dispatch()
145 pop->event_count * sizeof(struct pollfd)); in poll_dispatch()
150 pop->event_set_copy = tmp; in poll_dispatch()
151 pop->realloc_copy = 0; in poll_dispatch()
153 memcpy(pop->event_set_copy, pop->event_set, in poll_dispatch()
155 event_set = pop->event_set_copy; in poll_dispatch()
157 event_set = pop->event_set; in poll_dispatch()
160 event_set = pop->event_set; in poll_dispatch()
219 struct pollop *pop = base->evbase; in poll_add() local
228 poll_check_ok(pop); in poll_add()
229 if (pop->nfds + 1 >= pop->event_count) { in poll_add()
233 if (pop->event_count < 32) in poll_add()
236 tmp_event_count = pop->event_count * 2; in poll_add()
239 tmp_event_set = mm_realloc(pop->event_set, in poll_add()
245 pop->event_set = tmp_event_set; in poll_add()
247 pop->event_count = tmp_event_count; in poll_add()
248 pop->realloc_copy = 1; in poll_add()
254 pfd = &pop->event_set[i]; in poll_add()
256 i = pop->nfds++; in poll_add()
257 pfd = &pop->event_set[i]; in poll_add()
268 poll_check_ok(pop); in poll_add()
280 struct pollop *pop = base->evbase; in poll_del() local
289 poll_check_ok(pop); in poll_del()
295 pfd = &pop->event_set[i]; in poll_del()
300 poll_check_ok(pop); in poll_del()
308 --pop->nfds; in poll_del()
309 if (i != pop->nfds) { in poll_del()
314 memcpy(&pop->event_set[i], &pop->event_set[pop->nfds], in poll_del()
316 idx = evmap_io_get_fdinfo_(&base->io, pop->event_set[i].fd); in poll_del()
318 EVUTIL_ASSERT(idx->idxplus1 == pop->nfds + 1); in poll_del()
322 poll_check_ok(pop); in poll_del()
329 struct pollop *pop = base->evbase; in poll_dealloc() local
332 if (pop->event_set) in poll_dealloc()
333 mm_free(pop->event_set); in poll_dealloc()
334 if (pop->event_set_copy) in poll_dealloc()
335 mm_free(pop->event_set_copy); in poll_dealloc()
337 memset(pop, 0, sizeof(struct pollop)); in poll_dealloc()
338 mm_free(pop); in poll_dealloc()