X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/4e5f63a60c36f58bdecedc43262e7f89e28656d7..e480c279bc28832ca78a33f7f52c0b57ae5a16f1:/src/ae.h diff --git a/src/ae.h b/src/ae.h index 9e23a6fd..f52a075e 100644 --- a/src/ae.h +++ b/src/ae.h @@ -33,8 +33,6 @@ #ifndef __AE_H__ #define __AE_H__ -#define AE_SETSIZE (1024*10) /* Max number of fd supported */ - #define AE_OK 0 #define AE_ERR -1 @@ -87,10 +85,12 @@ typedef struct aeFiredEvent { /* State of an event based program */ typedef struct aeEventLoop { - int maxfd; + int maxfd; /* highest file descriptor currently registered */ + int setsize; /* max number of file descriptors tracked */ long long timeEventNextId; - aeFileEvent events[AE_SETSIZE]; /* Registered events */ - aeFiredEvent fired[AE_SETSIZE]; /* Fired events */ + time_t lastTime; /* Used to detect system clock skew */ + aeFileEvent *events; /* Registered events */ + aeFiredEvent *fired; /* Fired events */ aeTimeEvent *timeEventHead; int stop; void *apidata; /* This is used for polling API specific data */ @@ -98,7 +98,7 @@ typedef struct aeEventLoop { } aeEventLoop; /* Prototypes */ -aeEventLoop *aeCreateEventLoop(void); +aeEventLoop *aeCreateEventLoop(int setsize); void aeDeleteEventLoop(aeEventLoop *eventLoop); void aeStop(aeEventLoop *eventLoop); int aeCreateFileEvent(aeEventLoop *eventLoop, int fd, int mask,