summaryrefslogtreecommitdiff
path: root/lib/tevent
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2016-08-08 08:56:23 +0200
committerJeremy Allison <jra@samba.org>2016-08-24 01:33:48 +0200
commit80cd6b75288583086c7855a6c37be868d5e2cfb7 (patch)
tree5f342a91a483390aa87265f0cd4e507aacc5dd5e /lib/tevent
parent110f9258ddf995a334280c42b98e6f15d4d947d8 (diff)
downloadsamba-80cd6b75288583086c7855a6c37be868d5e2cfb7.tar.gz
tevent: reorder tevent_context for cache locality
No functionality change. This just looks better in objdump --disassemble :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/tevent')
-rw-r--r--lib/tevent/tevent_internal.h25
1 files changed, 16 insertions, 9 deletions
diff --git a/lib/tevent/tevent_internal.h b/lib/tevent/tevent_internal.h
index 6b29547427c..f17ce940365 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;