зеркало из https://github.com/mozilla/gecko-dev.git
bug 717175 - flush shaped-word caches if they grow excessively large. r=roc
This commit is contained in:
Родитель
91ee28a3e2
Коммит
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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче