mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
bug 717175 - flush shaped-word caches if they grow excessively large. r=roc
This commit is contained in:
parent
91ee28a3e2
commit
4db8132fe1
@ -2129,6 +2129,12 @@ gfxFont::GetShapedWord(gfxContext *aContext,
|
||||
PRInt32 aAppUnitsPerDevUnit,
|
||||
PRUint32 aFlags)
|
||||
{
|
||||
// if the cache is getting too big, flush it and start over
|
||||
if (mWordCache.Count() > 10000) {
|
||||
NS_WARNING("flushing shaped-word cache");
|
||||
ClearCachedWords();
|
||||
}
|
||||
|
||||
// if there's a cached entry for this word, just return it
|
||||
CacheHashKey key(aText, aLength, aHash,
|
||||
aRunScript,
|
||||
|
Loading…
Reference in New Issue
Block a user