21#include FT_INTERNAL_OBJECTS_H
22#include FT_INTERNAL_DEBUG_H
28#define FT_COMPONENT trace_cache
31#define FTC_HASH_MAX_LOAD 2
32#define FTC_HASH_MIN_LOAD 1
33#define FTC_HASH_SUB_LOAD ( FTC_HASH_MAX_LOAD - FTC_HASH_MIN_LOAD )
36#define FTC_HASH_INITIAL_SIZE 8
124 if (
cache->slack < 0 )
140 (
mask + 1 ) * 2, (
mask + 1 ) * 4 ) )
145 pnode =
cache->buckets +
p;
156 node->link = new_list;
179 FT_UFast old_index =
p +
mask;
203 pnode =
cache->buckets +
p;
205 pnode = &(*pnode)->
link;
207 pold =
cache->buckets + old_index;
237 FT_TRACE0((
"ftc_node_hash_unlink: unknown node\n" ));
244 pnode = &(*pnode)->
link;
247 *pnode = node0->
link;
281 if (
node->cache_index >= manager->num_caches )
283 FT_TRACE0((
"ftc_node_destroy: invalid node handle\n" ));
288 cache = manager->caches[
node->cache_index];
293 FT_TRACE0((
"ftc_node_destroy: invalid node handle\n" ));
311 if ( manager->num_nodes == 0 )
312 FT_TRACE0((
"ftc_node_destroy: invalid cache node count (%d)\n",
313 manager->num_nodes ));
497 if ( !
cache || !anode )
498 return FT_THROW( Invalid_Argument );
524 while ( *pnode !=
node )
528 FT_ERROR((
"FTC_Cache_Lookup: oops!!! node missing\n" ));
532 pnode = &((*pnode)->link);
537 if (
node != *bucket )
540 node->link = *bucket;
550 ftc_node_mru_up(
node, manager );
588 if (
cache->clazz.node_remove_faceid(
node, face_id,
589 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