Lines Matching refs:state
40 aeApiState *state = zmalloc(sizeof(aeApiState)); in aeApiCreate() local
42 if (!state) return -1; in aeApiCreate()
43 state->events = zmalloc(sizeof(struct epoll_event)*eventLoop->setsize); in aeApiCreate()
44 if (!state->events) { in aeApiCreate()
45 zfree(state); in aeApiCreate()
48 state->epfd = epoll_create(1024); /* 1024 is just a hint for the kernel */ in aeApiCreate()
49 if (state->epfd == -1) { in aeApiCreate()
50 zfree(state->events); in aeApiCreate()
51 zfree(state); in aeApiCreate()
54 eventLoop->apidata = state; in aeApiCreate()
59 aeApiState *state = eventLoop->apidata; in aeApiResize() local
61 state->events = zrealloc(state->events, sizeof(struct epoll_event)*setsize); in aeApiResize()
66 aeApiState *state = eventLoop->apidata; in aeApiFree() local
68 close(state->epfd); in aeApiFree()
69 zfree(state->events); in aeApiFree()
70 zfree(state); in aeApiFree()
74 aeApiState *state = eventLoop->apidata; in aeApiAddEvent() local
86 if (epoll_ctl(state->epfd,op,fd,&ee) == -1) return -1; in aeApiAddEvent()
91 aeApiState *state = eventLoop->apidata; in aeApiDelEvent() local
100 epoll_ctl(state->epfd,EPOLL_CTL_MOD,fd,&ee); in aeApiDelEvent()
104 epoll_ctl(state->epfd,EPOLL_CTL_DEL,fd,&ee); in aeApiDelEvent()
109 aeApiState *state = eventLoop->apidata; in aeApiPoll() local
112 retval = epoll_wait(state->epfd,state->events,eventLoop->setsize, in aeApiPoll()
120 struct epoll_event *e = state->events+j; in aeApiPoll()