[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    [PATCH] AIX, ltdl.c again
From:       <griff () ifi ! uio ! no>
Date:       2001-08-09 18:32:34
[Download RAW message or body]

Hi !

I use CVS HEAD (3 days old) and AIX 4.3.3.

The attached patch reduces the shared library loading times for
AIX quite a bit more. After the previous patch, .la files were still
processed several times to find out that the actual dlopening was
already done. That is suppressed with this patch.

Regards,
   Carsten


["ltdl.c.patch" (text/plain)]

--- kdelibs/libltdl/ltdl.c	Thu Aug  9 20:01:59 2001
+++ kdelibs-libltdl-ltdl.c.new	Thu Aug  9 20:03:13 2001
@@ -2301,6 +2301,8 @@
     if (handle != newhandle)
       {
 	unload_deplibs (handle);
+      } else {
+	handle->info.filename = strdup( filename );
       }
     }
   else
@@ -2389,7 +2391,6 @@
       return 0;
     }
 
-  /* try "filename.la" */
   tmp = LT_DLMALLOC (char, len+4);
   if (!tmp)
     {
@@ -2397,14 +2398,6 @@
       return 0;
     }
   strcpy (tmp, filename);
-  strcat (tmp, ".la");
-  handle = lt_dlopen (tmp);
-  if (handle)
-    {
-      MUTEX_SETERROR (saved_error);
-      LT_DLFREE (tmp);
-      return handle;
-    }
 
 #ifdef _AIX
   tmp[len] = '\0';
@@ -2426,7 +2419,20 @@
       LT_DLFREE (tmp);
       return handle;
     }
+#endif /* _AIX */
+
+  /* try "filename.la" */
+  strcat (tmp, ".la");
+  handle = lt_dlopen (tmp);
+  if (handle)
+    {
+      MUTEX_SETERROR (saved_error);
+      LT_DLFREE (tmp);
+      return handle;
+    }
+
 
+#ifdef _AIX
   /* versioned shared objects can be in .a's */
   strcat(tmp, ".a");
   handle = lt_dlopen (tmp);
@@ -3318,23 +3324,33 @@
 {
   lt_dlhandle cur;
   const char* la;
+  int         inlen;
 
   cur = handles;
 
   while (cur)
     {
-      if( cur->info.name && name &&
-	  !strcmp( cur->info.name, name ) )
+      if( cur->info.name && name )
         {
-	  if( cur->info.filename )
-	    {
-	      la = strrchr( cur->info.filename, '.' );
-	      if( !la || strcmp(la,".la") )
+	  if( !strcmp( cur->info.name, name ) )
+            {
+	      if( cur->info.filename )
 	        {
-	          return cur;
+	          la = strrchr( cur->info.filename, '.' );
+	          if( !la || strcmp(la,".la") )
+	            {
+	              return cur;
+	            }
 	        }
-	    }
+            }
         }
+      if( cur->info.filename && name )
+	{
+	  if( !strcmp( cur->info.filename, name ) )
+	    {
+	      return cur;
+	    }
+	}
       cur = cur->next;
     }
   return NULL;

>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic