mirror of
https://github.com/troglobit/libuev.git
synced 2026-10-25 11:34:32 +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
@@ -123,8 +123,8 @@ int uev_timer_set(uev_t *w, int timeout, int period)
|
||||
return -1;
|
||||
}
|
||||
|
||||
w->timeout = timeout;
|
||||
w->period = period;
|
||||
w->u.t.timeout = timeout;
|
||||
w->u.t.period = period;
|
||||
|
||||
if (w->ctx->running) {
|
||||
struct itimerspec time;
|
||||
@@ -153,7 +153,7 @@ int uev_timer_start(uev_t *w)
|
||||
if (-1 != w->fd)
|
||||
uev_watcher_stop(w);
|
||||
|
||||
return uev_timer_set(w, w->timeout, w->period);
|
||||
return uev_timer_set(w, w->u.t.timeout, w->u.t.period);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user