+2011-09-29 Andreas Kling <kling@webkit.org>
+
+ Shrink FontFallbackList.
+ https://bugs.webkit.org/show_bug.cgi?id=69093
+
+ Reviewed by Antti Koivisto.
+
+ Reduce the size of FontFallbackList by one CPU word, decreasing memory
+ consumption by 300 kB (on 64-bit) when loading the full HTML5 spec.
+
+ * platform/graphics/FontCache.h:
+ * platform/graphics/FontCache.cpp:
+ (WebCore::FontCache::generation):
+
+ Store the FontCache generation as an ushort rather than uint.
+
+ * platform/graphics/FontFallbackList.cpp:
+ (WebCore::FontFallbackList::FontFallbackList):
+ * platform/graphics/FontFallbackList.h:
+
+ Pack enum and bool members in a bitfield.
+
2011-09-29 Adam Barth <abarth@webkit.org>
We should ignore the return value of GetRealNamedProperty
gClients->remove(client);
}
-static unsigned gGeneration = 0;
+static unsigned short gGeneration = 0;
-unsigned FontCache::generation()
+unsigned short FontCache::generation()
{
return gGeneration;
}
, m_cachedPrimarySimpleFontData(0)
, m_fontSelector(0)
, m_familyIndex(0)
+ , m_generation(fontCache()->generation())
, m_pitch(UnknownPitch)
, m_loadingCustomFonts(false)
- , m_generation(fontCache()->generation())
{
}
mutable const SimpleFontData* m_cachedPrimarySimpleFontData;
RefPtr<FontSelector> m_fontSelector;
mutable int m_familyIndex;
- mutable Pitch m_pitch;
- mutable bool m_loadingCustomFonts;
- unsigned m_generation;
+ unsigned short m_generation;
+ mutable Pitch m_pitch : 3;
+ mutable bool m_loadingCustomFonts : 1;
friend class Font;
};