MCPcopy Create free account
hub / github.com/F-Stack/f-stack / aeApiCreate

Function aeApiCreate

app/redis-6.2.6/src/ae_evport.c:75–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73} aeApiState;
74
75static int aeApiCreate(aeEventLoop *eventLoop) {
76 int i;
77 aeApiState *state = zmalloc(sizeof(aeApiState));
78 if (!state) return -1;
79
80 state->portfd = port_create();
81 if (state->portfd == -1) {
82 zfree(state);
83 return -1;
84 }
85 anetCloexec(state->portfd);
86
87 state->npending = 0;
88
89 for (i = 0; i < MAX_EVENT_BATCHSZ; i++) {
90 state->pending_fds[i] = -1;
91 state->pending_masks[i] = AE_NONE;
92 }
93
94 eventLoop->apidata = state;
95 return 0;
96}
97
98static int aeApiResize(aeEventLoop *eventLoop, int setsize) {
99 (void) eventLoop;

Callers

nothing calls this directly

Calls 4

zmallocFunction · 0.85
port_createFunction · 0.85
anetCloexecFunction · 0.85
zfreeFunction · 0.70

Tested by

no test coverage detected