debugging new cache hash table implementation

This commit is contained in:
David Turner 2002-06-07 22:09:20 +00:00
parent 08b7ad4418
commit f47d5f0b39
5 changed files with 18 additions and 12 deletions

View File

@ -24,7 +24,7 @@
#undef FTC_CACHE_USE_INLINE #undef FTC_CACHE_USE_INLINE
/* define to use linear hash table */ /* define to use linear hash table */
#undef FTC_CACHE_USE_LINEAR_HASHING #define FTC_CACHE_USE_LINEAR_HASHING
FT_BEGIN_HEADER FT_BEGIN_HEADER

View File

@ -257,8 +257,8 @@ FT_BEGIN_HEADER
/* */ /* */
/* Don't define any of these macros to compile in `release' mode! */ /* Don't define any of these macros to compile in `release' mode! */
/* */ /* */
#undef FT_DEBUG_LEVEL_ERROR #define FT_DEBUG_LEVEL_ERROR
#undef FT_DEBUG_LEVEL_TRACE #define FT_DEBUG_LEVEL_TRACE
/*************************************************************************/ /*************************************************************************/
@ -273,7 +273,7 @@ FT_BEGIN_HEADER
/* Note that the memory debugger is only activated at runtime when */ /* Note that the memory debugger is only activated at runtime when */
/* when the _environment_ variable "FT_DEBUG_MEMORY" is also defined! */ /* when the _environment_ variable "FT_DEBUG_MEMORY" is also defined! */
/* */ /* */
#undef FT_DEBUG_MEMORY #define FT_DEBUG_MEMORY
/*************************************************************************/ /*************************************************************************/

18
src/cache/ftccache.c vendored
View File

@ -84,6 +84,8 @@
} }
else else
{ {
FT_ASSERT( manager->num_nodes == 0 );
node->mru_next = node; node->mru_next = node;
node->mru_prev = node; node->mru_prev = node;
} }
@ -98,21 +100,23 @@
ftc_node_mru_unlink( FTC_Node node, ftc_node_mru_unlink( FTC_Node node,
FTC_Manager manager ) FTC_Manager manager )
{ {
FTC_Node first = manager->nodes_list;
FTC_Node prev = node->mru_prev; FTC_Node prev = node->mru_prev;
FTC_Node next = node->mru_next; FTC_Node next = node->mru_next;
FTC_Node first = manager->nodes_list;
FT_ASSERT( first != NULL && manager->num_nodes > 0 );
FT_ASSERT( next->mru_prev == node );
FT_ASSERT( prev->mru_next == node );
prev->mru_next = next;
next->mru_prev = prev; next->mru_prev = prev;
prev->mru_next = next;
if ( node->mru_next == first ) if ( node == first )
{ {
/* this is the last node in the list; update its head pointer */ if ( node == next )
if ( node == first )
manager->nodes_list = NULL; manager->nodes_list = NULL;
else else
first->mru_prev = prev; manager->nodes_list = next;
} }
node->mru_next = NULL; node->mru_next = NULL;
@ -848,7 +852,7 @@
goto Exit; goto Exit;
} }
pnode = &(*pnode)->link; pnode = &node->link;
} }
} }

2
src/cache/ftccmap.c vendored
View File

@ -348,6 +348,8 @@
FT_UInt offset = (FT_UInt)( char_code - node->first ); FT_UInt offset = (FT_UInt)( char_code - node->first );
FT_ASSERT( offset < FTC_CMAP_INDICES_MAX );
gindex = node->indices[offset]; gindex = node->indices[offset];
if ( gindex == FTC_CMAP_UNKNOWN ) if ( gindex == FTC_CMAP_UNKNOWN )
{ {

View File

@ -45,7 +45,7 @@ T42_DRV_OBJ_S := $(OBJ_)type42.$O
# Type42 driver source file for single build # Type42 driver source file for single build
# #
T42_DRV_SRC_S := $(T42_DIR_)t42drivr.c T42_DRV_SRC_S := $(T42_DIR_)type42.c
# Type42 driver - single object # Type42 driver - single object