summaryrefslogtreecommitdiff
path: root/src/fclist.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2004-12-07 01:36:26 +0000
committerKeith Packard <keithp@keithp.com>2004-12-07 01:36:26 +0000
commit1c52c0f0600b4c61fb3b16d2d7b5fa35c3e1b7f0 (patch)
treef96770169445a0813855dbea5a2340a0589510d6 /src/fclist.c
parent46b51147d10db21a4d5992074bcdc9022f45856b (diff)
downloadfontconfig-1c52c0f0600b4c61fb3b16d2d7b5fa35c3e1b7f0.tar.gz
Reviewed by: Keith Packard <keithp@keithp.com>
memoize strings and share a single copy for all uses. Note that this could be improved further by using statically allocated blocks and gluing multiple strings together, but I'm basically lazy. In my environment with 800 font files, I get a savings of about 90KB.
Diffstat (limited to 'src/fclist.c')
-rw-r--r--src/fclist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fclist.c b/src/fclist.c
index 18d7e71..6730f20 100644
--- a/src/fclist.c
+++ b/src/fclist.c
@@ -82,7 +82,7 @@ FcObjectSetAdd (FcObjectSet *os, const char *object)
mid++;
memmove (os->objects + mid + 1, os->objects + mid,
(os->nobject - mid) * sizeof (const char *));
- os->objects[mid] = object;
+ os->objects[mid] = FcObjectStaticName (object);
os->nobject++;
return FcTrue;
}