zenilib: zenilib/jni/external/freetype2/src/cache/ftccache.c File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Functions
ftccache.c File Reference
`#include <ft2build.h>`
`#include "ftcmanag.h"`
`#include <FT_INTERNAL_OBJECTS_H>`
`#include <FT_INTERNAL_DEBUG_H>`
`#include "ftccback.h"`
`#include "ftcerror.h"`

Go to the source code of this file.

## Macros

#define | FT_COMPONENT trace_cache
#define | FTC_HASH_INITIAL_SIZE 8
#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 )

## Functions

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

## Macro Definition Documentation

#define FT_COMPONENT trace_cache

Definition at line 29 of file ftccache.c.

#define FTC_HASH_INITIAL_SIZE 8

Definition at line 37 of file ftccache.c.

Referenced by ftc_cache_init(), and ftc_cache_resize().

#define FTC_HASH_MAX_LOAD 2

Definition at line 32 of file ftccache.c.

Referenced by ftc_cache_init(), and ftc_cache_resize().

#define FTC_HASH_MIN_LOAD 1

Definition at line 33 of file ftccache.c.

#define FTC_HASH_SUB_LOAD ( FTC_HASH_MAX_LOAD - FTC_HASH_MIN_LOAD )

Definition at line 34 of file ftccache.c.

Referenced by ftc_cache_resize().

## Function Documentation

static void ftc_cache_add | ( | FTC_Cache | cache,
|  | FT_PtrDist | hash,
|  | FTC_Node | node
| ) |  |

static

Definition at line 421 of file ftccache.c.

References FTC_NodeRec_::cache_index, FTC_CacheRec_::clazz, FTC_ManagerRec_::cur_weight, FTC_Manager_Compress(), ftc_node_hash_link(), ftc_node_mru_link(), FTC_NodeRec_::hash, FTC_CacheRec_::index, FTC_CacheRec_::manager, FTC_ManagerRec_::max_weight, FTC_CacheClassRec_::node_weight, and FTC_NodeRec_::ref_count.

Referenced by FTC_Cache_NewNode().

static void FTC_Cache_Clear | ( | FTC_Cache | cache | ) |

static

Definition at line 356 of file ftccache.c.

References FTC_CacheRec_::buckets, FTC_CacheRec_::clazz, FTC_ManagerRec_::cur_weight, ftc_cache_resize(), ftc_node_mru_unlink(), i, FTC_NodeRec_::link, FTC_CacheRec_::manager, FTC_CacheRec_::mask, FTC_CacheClassRec_::node_free, FTC_CacheClassRec_::node_weight, NULL, and FTC_CacheRec_::p.

Referenced by ftc_cache_done().

ftc_cache_done | ( | FTC_Cache | cache | ) |

Definition at line 394 of file ftccache.c.

References FT_FREE, FTC_Cache_Clear(), and NULL.

Referenced by FTC_Cache_Done().

FTC_Cache_Done | ( | FTC_Cache | cache | ) |

Definition at line 414 of file ftccache.c.

References ftc_cache_done().

Referenced by ftc_gcache_done().

FTC_Cache_Init | ( | FTC_Cache | cache | ) |

Definition at line 333 of file ftccache.c.

References ftc_cache_init().

Referenced by ftc_gcache_init().

ftc_cache_init | ( | FTC_Cache | cache | ) |

Definition at line 340 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_NewNode | ( | FTC_Cache | cache,
|  | FT_PtrDist | hash,
|  | FT_Pointer | query,
|  | FTC_Node * | anode
| ) |  |

Definition at line 449 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 569 of file ftccache.c.

References FTC_ManagerRec_::cur_weight, FALSE, FT_Bool, 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 114 of file ftccache.c.

References FTC_CacheRec_::buckets, error, FT_RENEW_ARRAY, FTC_HASH_INITIAL_SIZE, FTC_HASH_MAX_LOAD, FTC_HASH_SUB_LOAD, FTC_NodeRec_::hash, FTC_NodeRec_::link, FTC_CacheRec_::mask, FTC_CacheRec_::memory, NULL, FTC_CacheRec_::p, and FTC_CacheRec_::slack.

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 278 of file ftccache.c.

References FTC_NodeRec_::cache_index, FTC_ManagerRec_::caches, FTC_CacheRec_::clazz, FTC_ManagerRec_::cur_weight, FT_TRACE0, ftc_node_hash_unlink(), ftc_node_mru_unlink(), FTC_CacheClassRec_::node_free, FTC_CacheClassRec_::node_weight, 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 258 of file ftccache.c.

References ftc_cache_resize(), FTC_NODE__TOP_FOR_HASH, FTC_NodeRec_::hash, FTC_NodeRec_::link, and FTC_CacheRec_::slack.

Referenced by ftc_cache_add().

static void ftc_node_hash_unlink | ( | FTC_Node | node0,
|  | FTC_Cache | cache
| ) |  |

static

Definition at line 225 of file ftccache.c.

References FT_TRACE0, ftc_cache_resize(), FTC_NODE__TOP_FOR_HASH, FTC_NodeRec_::hash, FTC_NodeRec_::link, NULL, and FTC_CacheRec_::slack.

Referenced by ftc_node_destroy().

static void ftc_node_mru_link | ( | FTC_Node | node,
|  | FTC_Manager | manager
| ) |  |

static

Definition at line 50 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 64 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().