Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

event: minimize the size of structures by field order #10

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions event.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,23 @@ struct vhd_event_loop {

/* eventfd we use to cancel epoll_wait if needed */
int notifyfd;

/* number of currently attached events (for consistency checks) */
uint32_t num_events_attached;

bool notified;

/* vhd_terminate_event_loop has been completed */
bool is_terminated;

bool has_home_thread;

/* preallocated events buffer */
struct epoll_event *events;
size_t max_events;

/* number of currently attached events (for consistency checks) */
unsigned num_events_attached;
uint64_t max_events;

vhd_bh_list bh_list;

bool has_home_thread;

SLIST_HEAD(, vhd_io_handler) deleted_handlers;
};

Expand Down Expand Up @@ -237,10 +238,10 @@ static void bh_cleanup(struct vhd_event_loop *ctx)

struct vhd_io_handler {
struct vhd_event_loop *evloop;
int fd;
int (*read)(void *opaque);
/* FIXME: must really include write handler as well */
void *opaque;
int fd;

bool attached;
SLIST_ENTRY(vhd_io_handler) deleted_entry;
Expand Down
Loading