+ if ((eventLoop = zmalloc(sizeof(*eventLoop))) == NULL) return NULL;
+ eventLoop->events = NULL;
+ eventLoop->fired = NULL;
+ eventLoop->events = zmalloc(sizeof(aeFileEvent)*setsize);
+ eventLoop->fired = zmalloc(sizeof(aeFiredEvent)*setsize);
+ if (eventLoop->events == NULL || eventLoop->fired == NULL) {
+ zfree(eventLoop->events);
+ zfree(eventLoop->fired);
+ zfree(eventLoop);
+ return NULL;
+ }
+ eventLoop->setsize = setsize;