]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add support for malloc_history for performance tuning.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 10 Sep 2007 18:15:36 +0000 (18:15 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 10 Sep 2007 18:15:36 +0000 (18:15 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@6936 7a7537e8-13f0-0310-91df-b6672ffda945

cups/testppd.c

index edb3e4aeb44c7bee9184c4039727aa2489badbc9..78e145711b8e56ed622a647501e202b50afa73ce 100644 (file)
@@ -235,8 +235,6 @@ main(int  argc,                             /* I - Number of command-line arguments */
       status ++;
       printf("FAIL (\"%s\" instead of \"Number 1 Foo Reason\")\n", buffer);
     }
-
-    ppdClose(ppd);
   }
   else
   {
@@ -362,11 +360,23 @@ main(int  argc,                           /* I - Number of command-line arguments */
           attr = (ppd_attr_t *)cupsArrayNext(ppd->sorted_attrs))
         printf("    *%s %s/%s: \"%s\"\n", attr->name, attr->spec,
               attr->text, attr->value ? attr->value : "");
-
-      ppdClose(ppd);
     }
   }
 
+#ifdef __APPLE__
+  if (getenv("MallocStackLogging") && getenv("MallocStackLoggingNoCompact"))
+  {
+    char       command[1024];          /* malloc_history command */
+
+    snprintf(command, sizeof(command), "malloc_history %d -all_by_size",
+            getpid());
+    fflush(stdout);
+    system(command);
+  }
+#endif /* __APPLE__ */
+
+  ppdClose(ppd);
+
   return (status);
 }