diff options
author | Søren Sandmann Pedersen <sandmann@redhat.com> | 2009-04-03 04:08:41 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <sandmann@redhat.com> | 2009-04-03 04:08:41 -0400 |
commit | 9cdb80aa2b160511098f7e3765ab7f20f543621c (patch) | |
tree | a38ab221c142810c5feecdd4a8dfb09257560096 /epoll.c | |
parent | 3806d124039b145e3efaf1e74767f00678ed1386 (diff) |
Slightly reduce memory use in epoll
Diffstat (limited to 'epoll.c')
-rw-r--r-- | epoll.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -5,15 +5,10 @@ typedef struct FdInfo FdInfo; struct FdInfo { - /* FIXME: we might want to compress this struct at some point. - * Though, if we have 100000 fd's, it's only 1.6 MB, which is - * almost nothing for that many clients, Still, cache use - * would improve. - */ - gboolean valid; - gboolean disabled; - nul_poll_event_type_t mask; - gpointer data; + gpointer data; + unsigned int mask : 16; + unsigned int valid : 1; + unsigned int disabled : 1; }; struct nul_poll_t @@ -42,6 +37,8 @@ nul_poll_add_fd (nul_poll_t *nul_poll, gpointer data) { g_return_if_fail (!nul_poll_has_fd (nul_poll, fd)); + + mask &= (NUL_POLL_RESERVED - 1); while (fd >= nul_poll->n_fd_infos) nul_poll->n_fd_infos *= 2; |