27#define FT_COMPONENT cache
30#define FTC_HASH_MAX_LOAD 2
31#define FTC_HASH_MIN_LOAD 1
32#define FTC_HASH_SUB_LOAD ( FTC_HASH_MAX_LOAD - FTC_HASH_MIN_LOAD )
35#define FTC_HASH_INITIAL_SIZE 8
123 if (
cache->slack < 0 )
139 (
mask + 1 ) * 2, (
mask + 1 ) * 4 ) )
144 pnode =
cache->buckets +
p;
155 node->link = new_list;
178 FT_UFast old_index =
p +
mask;
202 pnode =
cache->buckets +
p;
204 pnode = &(*pnode)->
link;
206 pold =
cache->buckets + old_index;
236 FT_TRACE0((
"ftc_node_hash_unlink: unknown node\n" ));
243 pnode = &(*pnode)->
link;
246 *pnode = node0->
link;
280 if (
node->cache_index >= manager->num_caches )
282 FT_TRACE0((
"ftc_node_destroy: invalid node handle\n" ));
287 cache = manager->caches[
node->cache_index];
292 FT_TRACE0((
"ftc_node_destroy: invalid node handle\n" ));
310 if ( manager->num_nodes == 0 )
311 FT_TRACE0((
"ftc_node_destroy: invalid cache node count (%d)\n",
312 manager->num_nodes ));
496 if ( !
cache || !anode )
497 return FT_THROW( Invalid_Argument );
523 while ( *pnode !=
node )
527 FT_ERROR((
"FTC_Cache_Lookup: oops!!! node missing\n" ));
531 pnode = &((*pnode)->link);
536 if (
node != *bucket )
539 node->link = *bucket;
549 ftc_node_mru_up(
node, manager );
587 if (
cache->clazz.node_remove_faceid(
node, face_id,
588 cache, &list_changed ) )
FT_BEGIN_HEADER typedef FT_Pointer FTC_FaceID
static void ftc_cache_resize(FTC_Cache cache)
static void ftc_node_mru_link(FTC_Node node, FTC_Manager manager)
ftc_cache_init(FTC_Cache cache)
static void ftc_node_mru_unlink(FTC_Node node, FTC_Manager manager)
FTC_Cache_NewNode(FTC_Cache cache, FT_Offset hash, FT_Pointer query, FTC_Node *anode)
static void FTC_Cache_Clear(FTC_Cache cache)
ftc_node_destroy(FTC_Node node, FTC_Manager manager)
FTC_Cache_Done(FTC_Cache cache)
#define FTC_HASH_SUB_LOAD
#define FTC_HASH_INITIAL_SIZE
#define FTC_HASH_MAX_LOAD
static void ftc_node_hash_link(FTC_Node node, FTC_Cache cache)
static void ftc_cache_add(FTC_Cache cache, FT_Offset hash, FTC_Node node)
FTC_Cache_Init(FTC_Cache cache)
FTC_Cache_RemoveFaceID(FTC_Cache cache, FTC_FaceID face_id)
static void ftc_node_hash_unlink(FTC_Node node0, FTC_Cache cache)
ftc_cache_done(FTC_Cache cache)
#define FTC_CACHE_TRYLOOP_END(list_changed)
#define FTC_NODE_TOP_FOR_HASH(cache, hash)
#define FTC_CACHE_TRYLOOP(cache)
FT_Bool(* FTC_Node_CompareFunc)(FTC_Node node, FT_Pointer key, FTC_Cache cache, FT_Bool *list_changed)
FTC_Manager_Compress(FTC_Manager manager)
FTC_MruNode_Up(FTC_MruNode *plist, FTC_MruNode node)
FTC_MruNode_Prepend(FTC_MruNode *plist, FTC_MruNode node)
FTC_MruNode_Remove(FTC_MruNode *plist, FTC_MruNode node)
typedefFT_BEGIN_HEADER struct FTC_MruNodeRec_ * FTC_MruNode
#define FT_TRACE0(varformat)
#define FT_ERROR(varformat)
#define FT_NEW_ARRAY(ptr, count)
#define FT_RENEW_ARRAY(ptr, curcnt, newcnt)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLuint GLuint GLsizei count
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static char memory[1024 *256]
static unsigned __int64 next