mirror of
https://github.com/troglobit/libuev.git
synced 2026-11-11 16:40:35 +00:00
Refactor: move private watcher members to a union
This will save a few bytes of stack/heap for users. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
1f6fa93314
commit
e5bc49a8e6
4 files changed
+21
-14
No files matched your search
@@ -61,12 +61,19 @@ struct uev;
|
||||
void (*cb)(struct uev *, void *, int); \
|
||||
void *arg; \
|
||||
\
|
||||
/* Timer watchers, time in milliseconds */ \
|
||||
int timeout; \
|
||||
int period; \
|
||||
/* Arguments for different watchers */ \
|
||||
union { \
|
||||
/* Timer watchers, time in milliseconds */ \
|
||||
struct { \
|
||||
int timeout; \
|
||||
int period; \
|
||||
} t; \
|
||||
\
|
||||
/* Signal watchers */ \
|
||||
int signo; \
|
||||
/* Signal watchers */ \
|
||||
struct { \
|
||||
int signo; \
|
||||
} s; \
|
||||
} u; \
|
||||
\
|
||||
/* Watcher type */ \
|
||||
uev_type_t
|
||||
|
||||
Reference in new issue
Block a user