]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcinit.c
Leave cache files mapped permanently.
[fontconfig.git] / src / fcinit.c
index d3e927f891f2f8a77c8f5329512887e6b1c99aeb..f64c0f0dcb1f5e03ad1d25b4e65060c995097ff3 100644 (file)
@@ -22,8 +22,8 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-#include <stdlib.h>
 #include "fcint.h"
+#include <stdlib.h>
 
 static FcConfig *
 FcInitFallbackConfig (void)
@@ -35,6 +35,8 @@ FcInitFallbackConfig (void)
        goto bail0;
     if (!FcConfigAddDir (config, (FcChar8 *) FC_DEFAULT_FONTS))
        goto bail1;
+    if (!FcConfigAddCacheDir (config, (FcChar8 *) FC_CACHEDIR))
+       goto bail1;
     return config;
 
 bail1:
@@ -57,6 +59,7 @@ FcInitLoadConfig (void)
 {
     FcConfig   *config;
     
+    FcInitDebug ();
     config = FcConfigCreate ();
     if (!config)
        return FcFalse;
@@ -78,6 +81,7 @@ FcInitLoadConfigAndFonts (void)
 {
     FcConfig   *config = FcInitLoadConfig ();
 
+    FcInitDebug ();
     if (!config)
        return 0;
     if (!FcConfigBuildFonts (config))
@@ -116,8 +120,8 @@ FcFini (void)
     if (_fcConfig)
        FcConfigDestroy (_fcConfig);
 
-    FcPatternThawAll ();
-    FcCharSetThawAll ();
+    FcPatternFini ();
+    FcCacheFini ();
 }
 
 /*
@@ -161,7 +165,7 @@ FcInitBringUptoDate (void)
 }
 
 static struct {
-    char    *name;
+    char    name[16];
     int            alloc_count;
     int            alloc_mem;
     int            free_count;
@@ -196,6 +200,7 @@ static struct {
     { "vstack" },
     { "attr" },
     { "pstack" },
+    { "staticstr" },
 };
 
 static int  FcAllocCount, FcAllocMem;
@@ -205,9 +210,6 @@ static int  FcMemNotice = 1*1024*1024;
 
 static int  FcAllocNotify, FcFreeNotify;
 
-void
-FcValueListReport (void);
-
 void
 FcMemReport (void)
 {
@@ -216,13 +218,13 @@ FcMemReport (void)
     printf ("\t   Which       Alloc           Free           Active\n");
     printf ("\t           count   bytes   count   bytes   count   bytes\n");
     for (i = 0; i < FC_MEM_NUM; i++)
-       printf ("\t%8.8s%8d%8d%8d%8d%8d%8d\n",
+       printf ("%16.16s%8d%8d%8d%8d%8d%8d\n",
                FcInUse[i].name,
                FcInUse[i].alloc_count, FcInUse[i].alloc_mem,
                FcInUse[i].free_count, FcInUse[i].free_mem,
                FcInUse[i].alloc_count - FcInUse[i].free_count,
                FcInUse[i].alloc_mem - FcInUse[i].free_mem);
-    printf ("\t%8.8s%8d%8d%8d%8d%8d%8d\n",
+    printf ("%16.16s%8d%8d%8d%8d%8d%8d\n",
            "Total",
            FcAllocCount, FcAllocMem,
            FcFreeCount, FcFreeMem,
@@ -230,7 +232,6 @@ FcMemReport (void)
            FcAllocMem - FcFreeMem);
     FcAllocNotify = 0;
     FcFreeNotify = 0;
-    FcValueListReport ();
 }
 
 void