[launchd-changes] [22925] trunk/launchd/src/launchd_core_logic.c

source_changes at macosforge.org source_changes at macosforge.org
Fri Oct 27 10:52:51 PDT 2006


Revision: 22925
          http://trac.macosforge.org/projects/launchd/changeset/22925
Author:   zarzycki at apple.com
Date:     2006-10-27 10:52:50 -0700 (Fri, 27 Oct 2006)

Log Message:
-----------
Since Mach service lookups are O(n) right now, let's keep the popular (MRU) services at the head of the list.

Modified Paths:
--------------
    trunk/launchd/src/launchd_core_logic.c

Modified: trunk/launchd/src/launchd_core_logic.c
===================================================================
--- trunk/launchd/src/launchd_core_logic.c	2006-10-26 21:50:06 UTC (rev 22924)
+++ trunk/launchd/src/launchd_core_logic.c	2006-10-27 17:52:50 UTC (rev 22925)
@@ -3040,6 +3040,10 @@
 
 		SLIST_FOREACH(ms, &ji->machservices, sle) {
 			if (strcmp(name, ms->name) == 0) {
+				if (ji->parent) {
+					SLIST_REMOVE(&ji->parent->jobs, ji, job_s, sle);
+					SLIST_INSERT_HEAD(&ji->parent->jobs, ji, sle);
+				}
 				return ms;
 			}
 		}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20061027/46f798b4/attachment.html


More information about the launchd-changes mailing list