diff options
author | Patrick Lam <plam@MIT.EDU> | 2005-08-24 06:21:30 +0000 |
---|---|---|
committer | Patrick Lam <plam@MIT.EDU> | 2005-08-24 06:21:30 +0000 |
commit | 4262e0b3853bc2153270eb33d09a063f852f3f90 (patch) | |
tree | ba08c194f10446f4318c72538f9df5e812f1e462 /fc-cache | |
parent | 212c9f437e959fbdc5fe344c67b8c1cf8ca63edb (diff) | |
download | fontconfig-4262e0b3853bc2153270eb33d09a063f852f3f90.tar.gz |
Overhaul the serialization system to create one mmapable file per directory
and distribute bytes for each directory from a single malloc for that
directory. Store pointers as differences between the data pointed to
and the pointer's address (s_off = s - v). Don't serialize data
structures that never actually get serialized. Separate strings used
for keys from strings used for values (in FcPatternElt and FcValue,
respectively). Bump FC_CACHE_VERSION to 2.
Diffstat (limited to 'fc-cache')
-rw-r--r-- | fc-cache/fc-cache.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fc-cache/fc-cache.c b/fc-cache/fc-cache.c index 7d01ccf..d2809ee 100644 --- a/fc-cache/fc-cache.c +++ b/fc-cache/fc-cache.c @@ -93,7 +93,6 @@ usage (char *program) exit (1); } -#if 0 static int nsubdirs (FcStrSet *set) { @@ -192,6 +191,7 @@ scanDirs (FcStrList *list, FcConfig *config, char *program, FcBool force, FcBool ret++; continue; } +#if 0 // put this back later after fixing DirCacheValid if (!force && FcDirCacheValid (dir)) { if (verbose) @@ -199,11 +199,13 @@ scanDirs (FcStrList *list, FcConfig *config, char *program, FcBool force, FcBool set->nfont, nsubdirs(subdirs)); } else +#endif { if (verbose) printf ("caching, %d fonts, %d dirs\n", set->nfont, nsubdirs (subdirs)); - if (!FcDirSave (set, subdirs, dir)) + + if (!FcDirSave (set, dir)) { fprintf (stderr, "Can't save cache in \"%s\"\n", dir); ret++; @@ -223,7 +225,6 @@ scanDirs (FcStrList *list, FcConfig *config, char *program, FcBool force, FcBool FcStrListDone (list); return ret; } -#endif int main (int argc, char **argv) @@ -280,10 +281,6 @@ main (int argc, char **argv) return 1; } - /* We don't yet have per-directory caches. */ - ret = (FcCacheWrite (config) == FcFalse); - -#if 0 if (argv[i]) { dirs = FcStrSetCreate (); @@ -308,7 +305,6 @@ main (int argc, char **argv) else list = FcConfigGetConfigDirs (config); ret = scanDirs (list, config, argv[0], force, verbose); -#endif /* * Now we need to sleep a second (or two, to be extra sure), to make * sure that timestamps for changes after this run of fc-cache are later |