ftccache.c File Reference

#include <ft2build.h>
#include "ftcmanag.h"
#include "ftccback.h"
#include "ftcerror.h"

Go to the source code of this file.

Defines

#define FT_COMPONENT   trace_cache
#define FTC_HASH_MAX_LOAD   2
#define FTC_HASH_MIN_LOAD   1
#define FTC_HASH_SUB_LOAD   ( FTC_HASH_MAX_LOAD - FTC_HASH_MIN_LOAD )
#define FTC_HASH_INITIAL_SIZE   8

Functions

static void ftc_node_mru_link (FTC_Node node, FTC_Manager manager)
static void ftc_node_mru_unlink (FTC_Node node, FTC_Manager manager)
static void ftc_cache_resize (FTC_Cache cache)
static void ftc_node_hash_unlink (FTC_Node node0, FTC_Cache cache)
static void ftc_node_hash_link (FTC_Node node, FTC_Cache cache)
 ftc_node_destroy (FTC_Node node, FTC_Manager manager)
 FTC_Cache_Init (FTC_Cache cache)
 ftc_cache_init (FTC_Cache cache)
static void FTC_Cache_Clear (FTC_Cache cache)
 ftc_cache_done (FTC_Cache cache)
 FTC_Cache_Done (FTC_Cache cache)
static void ftc_cache_add (FTC_Cache cache, FT_UInt32 hash, FTC_Node node)
 FTC_Cache_NewNode (FTC_Cache cache, FT_UInt32 hash, FT_Pointer query, FTC_Node *anode)
 FTC_Cache_RemoveFaceID (FTC_Cache cache, FTC_FaceID face_id)


Define Documentation

#define FT_COMPONENT   trace_cache

Definition at line 28 of file ftccache.c.

#define FTC_HASH_INITIAL_SIZE   8

Definition at line 36 of file ftccache.c.

Referenced by ftc_cache_init().

#define FTC_HASH_MAX_LOAD   2

Definition at line 31 of file ftccache.c.

Referenced by ftc_cache_init(), and ftc_cache_resize().

#define FTC_HASH_MIN_LOAD   1

Definition at line 32 of file ftccache.c.

#define FTC_HASH_SUB_LOAD   ( FTC_HASH_MAX_LOAD - FTC_HASH_MIN_LOAD )

Definition at line 33 of file ftccache.c.


Function Documentation

static void ftc_cache_add ( FTC_Cache  cache,
FT_UInt32  hash,
FTC_Node  node 
) [static]

Definition at line 412 of file ftccache.c.

References FTC_NodeRec_::cache_index, FTC_ManagerRec_::cur_weight, FTC_Manager_Compress(), ftc_node_hash_link(), ftc_node_mru_link(), FTC_NodeRec_::hash, FTC_ManagerRec_::max_weight, and FTC_NodeRec_::ref_count.

Referenced by FTC_Cache_NewNode().

static void FTC_Cache_Clear ( FTC_Cache  cache  )  [static]

Definition at line 347 of file ftccache.c.

References FTC_ManagerRec_::cur_weight, ftc_cache_resize(), ftc_node_mru_unlink(), i, FTC_NodeRec_::link, and NULL.

Referenced by ftc_cache_done().

FTC_Cache_Done ( FTC_Cache  cache  ) 

Definition at line 405 of file ftccache.c.

References ftc_cache_done().

Referenced by ftc_gcache_done().

ftc_cache_done ( FTC_Cache  cache  ) 

Definition at line 385 of file ftccache.c.

References FT_FREE, FTC_Cache_Clear(), and NULL.

Referenced by FTC_Cache_Done().

ftc_cache_init ( FTC_Cache  cache  ) 

Definition at line 331 of file ftccache.c.

References error, FT_NEW_ARRAY, FTC_HASH_INITIAL_SIZE, and FTC_HASH_MAX_LOAD.

Referenced by FTC_Cache_Init().

FTC_Cache_Init ( FTC_Cache  cache  ) 

Definition at line 324 of file ftccache.c.

References ftc_cache_init().

Referenced by ftc_gcache_init().

FTC_Cache_NewNode ( FTC_Cache  cache,
FT_UInt32  hash,
FT_Pointer  query,
FTC_Node anode 
)

Definition at line 440 of file ftccache.c.

References error, ftc_cache_add(), FTC_CACHE_TRYLOOP, FTC_CACHE_TRYLOOP_END, and NULL.

FTC_Cache_RemoveFaceID ( FTC_Cache  cache,
FTC_FaceID  face_id 
)

Definition at line 540 of file ftccache.c.

References FTC_ManagerRec_::cur_weight, for(), ftc_cache_resize(), ftc_node_mru_unlink(), i, FTC_NodeRec_::link, and NULL.

Referenced by FTC_Manager_RemoveFaceID().

static void ftc_cache_resize ( FTC_Cache  cache  )  [static]

Definition at line 94 of file ftccache.c.

References error, FT_RENEW_ARRAY, FTC_HASH_MAX_LOAD, FTC_NodeRec_::hash, if(), FTC_NodeRec_::link, mask, NULL, and p.

Referenced by FTC_Cache_Clear(), FTC_Cache_RemoveFaceID(), ftc_node_hash_link(), and ftc_node_hash_unlink().

ftc_node_destroy ( FTC_Node  node,
FTC_Manager  manager 
)

Definition at line 269 of file ftccache.c.

References FTC_NodeRec_::cache_index, FTC_ManagerRec_::caches, FTC_ManagerRec_::cur_weight, FT_TRACE0, ftc_node_hash_unlink(), ftc_node_mru_unlink(), NULL, FTC_ManagerRec_::num_caches, and FTC_ManagerRec_::num_nodes.

Referenced by FTC_Manager_Compress(), and FTC_Manager_FlushN().

static void ftc_node_hash_link ( FTC_Node  node,
FTC_Cache  cache 
) [static]

Definition at line 242 of file ftccache.c.

References ftc_cache_resize(), FTC_NodeRec_::hash, FTC_NodeRec_::link, and p.

Referenced by ftc_cache_add().

static void ftc_node_hash_unlink ( FTC_Node  node0,
FTC_Cache  cache 
) [static]

Definition at line 202 of file ftccache.c.

References FT_TRACE0, ftc_cache_resize(), FTC_NodeRec_::hash, FTC_NodeRec_::link, NULL, and p.

Referenced by ftc_node_destroy().

static void ftc_node_mru_link ( FTC_Node  node,
FTC_Manager  manager 
) [static]

Definition at line 49 of file ftccache.c.

References FTC_MruNode_Prepend(), FTC_ManagerRec_::nodes_list, and FTC_ManagerRec_::num_nodes.

Referenced by ftc_cache_add().

static void ftc_node_mru_unlink ( FTC_Node  node,
FTC_Manager  manager 
) [static]

Definition at line 63 of file ftccache.c.

References FTC_MruNode_Remove(), FTC_ManagerRec_::nodes_list, and FTC_ManagerRec_::num_nodes.

Referenced by FTC_Cache_Clear(), FTC_Cache_RemoveFaceID(), and ftc_node_destroy().


Generated on Tue Jul 5 15:58:22 2011 for ROOT_528-00b_version by  doxygen 1.5.1