xserver: Branch 'master' - 2 commits

Adam Jackson ajax at kemper.freedesktop.org
Mon May 21 17:55:41 UTC 2018


 os/WaitFor.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 1e9d5533e3c08fc22099d6dd0f11fa642ab4f1b0
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Apr 15 15:40:05 2018 +0100

    os/WaitFor: Use the simpler xorg_list_for_each_entry()
    
    As we are not freeing elements while iterating the list of timers, we
    can forgo using the safe variant, and reduce the number of pointer
    dances required for the insertion sort.
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/os/WaitFor.c b/os/WaitFor.c
index e3b545b93..ae317dc11 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -295,7 +295,7 @@ OsTimerPtr
 TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
          OsTimerCallback func, void *arg)
 {
-    OsTimerPtr existing, tmp;
+    OsTimerPtr existing;
     CARD32 now = GetTimeInMillis();
 
     if (!timer) {
@@ -328,7 +328,7 @@ TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
     input_lock();
 
     /* Sort into list */
-    xorg_list_for_each_entry_safe(existing, tmp, &timers, list)
+    xorg_list_for_each_entry(existing, &timers, list)
         if ((int) (existing->expires - millis) > 0)
             break;
     /* This even works at the end of the list -- existing->list will be timers */
commit 6115d8b40ce0c91620b6d5e7d18e0da704409f89
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Apr 15 15:40:04 2018 +0100

    os/WaitFor: Use xorg_list_append()
    
    Currently, we use xorg_list_add(new, head->prev) which is functionaly
    equivalent to xorg_list_append(), but with more pointer chasing, so
    reduce the strain on the reader and compiler by using the simpler
    append().
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/os/WaitFor.c b/os/WaitFor.c
index 7c7b1d2d4..e3b545b93 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -332,7 +332,7 @@ TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
         if ((int) (existing->expires - millis) > 0)
             break;
     /* This even works at the end of the list -- existing->list will be timers */
-    xorg_list_add(&timer->list, existing->list.prev);
+    xorg_list_append(&timer->list, &existing->list);
 
     /* Check to see if the timer is ready to run now */
     if ((int) (millis - now) <= 0)


More information about the xorg-commit mailing list