Skip to content
Commits on Source (2)
......@@ -318,13 +318,6 @@
/*************************************************************************/
FT_LOCAL_DEF( FT_Error )
FTC_Cache_Init( FTC_Cache cache )
{
return ftc_cache_init( cache );
}
FT_LOCAL_DEF( FT_Error )
ftc_cache_init( FTC_Cache cache )
{
......@@ -341,10 +334,20 @@
}
static void
FTC_Cache_Clear( FTC_Cache cache )
FT_LOCAL_DEF( FT_Error )
FTC_Cache_Init( FTC_Cache cache )
{
return ftc_cache_init( cache );
}
FT_LOCAL_DEF( void )
ftc_cache_done( FTC_Cache cache )
{
if ( cache && cache->buckets )
FT_Memory memory = cache->memory;
if ( cache->buckets )
{
FTC_Manager manager = cache->manager;
FT_UFast count = cache->p;
......@@ -370,30 +373,14 @@
cache->clazz.node_free( node, cache );
node = next;
}
cache->buckets[i] = NULL;
}
ftc_cache_resize( cache );
}
}
FT_FREE( cache->buckets );
FT_LOCAL_DEF( void )
ftc_cache_done( FTC_Cache cache )
{
if ( cache->memory )
{
FT_Memory memory = cache->memory;
FTC_Cache_Clear( cache );
FT_FREE( cache->buckets );
cache->mask = 0;
cache->p = 0;
cache->slack = 0;
cache->memory = NULL;
}
cache->p = 0;
cache->mask = 0;
cache->slack = 0;
}
......
......@@ -101,22 +101,22 @@
FT_LOCAL_DEF( FT_Error )
ftc_gcache_init( FTC_Cache ftccache )
ftc_gcache_init( FTC_Cache cache )
{
FTC_GCache cache = (FTC_GCache)ftccache;
FTC_GCache gcache = (FTC_GCache)cache;
FT_Error error;
error = FTC_Cache_Init( FTC_CACHE( cache ) );
error = FTC_Cache_Init( cache );
if ( !error )
{
FTC_GCacheClass clazz = (FTC_GCacheClass)FTC_CACHE( cache )->org_class;
FTC_GCacheClass clazz = (FTC_GCacheClass)cache->org_class;
FTC_MruList_Init( &cache->families,
FTC_MruList_Init( &gcache->families,
clazz->family_class,
0, /* no maximum here! */
cache,
FTC_CACHE( cache )->memory );
cache->memory );
}
return error;
......@@ -126,31 +126,31 @@
#if 0
FT_LOCAL_DEF( FT_Error )
FTC_GCache_Init( FTC_GCache cache )
FTC_GCache_Init( FTC_GCache gcache )
{
return ftc_gcache_init( FTC_CACHE( cache ) );
return ftc_gcache_init( FTC_CACHE( gcache ) );
}
#endif /* 0 */
FT_LOCAL_DEF( void )
ftc_gcache_done( FTC_Cache ftccache )
ftc_gcache_done( FTC_Cache cache )
{
FTC_GCache cache = (FTC_GCache)ftccache;
FTC_GCache gcache = (FTC_GCache)cache;
FTC_Cache_Done( (FTC_Cache)cache );
FTC_MruList_Done( &cache->families );
FTC_Cache_Done( cache );
FTC_MruList_Done( &gcache->families );
}
#if 0
FT_LOCAL_DEF( void )
FTC_GCache_Done( FTC_GCache cache )
FTC_GCache_Done( FTC_GCache gcache )
{
ftc_gcache_done( FTC_CACHE( cache ) );
ftc_gcache_done( FTC_CACHE( gcache ) );
}
#endif /* 0 */
......@@ -169,7 +169,7 @@
#ifndef FTC_INLINE
FT_LOCAL_DEF( FT_Error )
FTC_GCache_Lookup( FTC_GCache cache,
FTC_GCache_Lookup( FTC_GCache gcache,
FT_Offset hash,
FT_UInt gindex,
FTC_GQuery query,
......@@ -190,7 +190,7 @@
/* out-of-memory condition occurs during glyph node initialization. */
family->num_nodes++;
error = FTC_Cache_Lookup( FTC_CACHE( cache ), hash, query, anode );
error = FTC_Cache_Lookup( FTC_CACHE( gcache ), hash, query, anode );
if ( --family->num_nodes == 0 )
FTC_FAMILY_FREE( family, cache );
......
......@@ -342,7 +342,7 @@
FT_Bool result;
if (list_changed)
if ( list_changed )
*list_changed = FALSE;
result = FT_BOOL( gnode->family == gquery->family &&
gindex - gnode->gindex < snode->count );
......