From: Volker Lendecke Date: Mon, 8 Aug 2016 06:56:23 +0000 (+0200) Subject: tevent: reorder tevent_context for cache locality X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=80cd6b75288583086c7855a6c37be868d5e2cfb7;p=metze%2Fsamba%2Fwip.git tevent: reorder tevent_context for cache locality No functionality change. This just looks better in objdump --disassemble :-) Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- diff --git a/lib/tevent/tevent_internal.h b/lib/tevent/tevent_internal.h index 6b29547427ce..f17ce9403652 100644 --- a/lib/tevent/tevent_internal.h +++ b/lib/tevent/tevent_internal.h @@ -246,25 +246,32 @@ struct tevent_context { /* the specific events implementation */ const struct tevent_ops *ops; + /* + * The following three pointers are queried on every loop_once + * in the order in which they appear here. Not measured, but + * hopefully putting them at the top together with "ops" + * should make tevent a *bit* more cache-friendly than before. + */ + + /* list of signal events - used by common code */ + struct tevent_signal *signal_events; + + /* List of threaded job indicators */ + struct tevent_threaded_context *threaded_contexts; + + /* list of immediate events - used by common code */ + struct tevent_immediate *immediate_events; + /* list of fd events - used by common code */ struct tevent_fd *fd_events; /* list of timed events - used by common code */ struct tevent_timer *timer_events; - /* List of threaded job indicators */ - struct tevent_threaded_context *threaded_contexts; - /* List of scheduled immediates */ pthread_mutex_t scheduled_mutex; struct tevent_immediate *scheduled_immediates; - /* list of immediate events - used by common code */ - struct tevent_immediate *immediate_events; - - /* list of signal events - used by common code */ - struct tevent_signal *signal_events; - /* this is private for the events_ops implementation */ void *additional_data;