Sign in Join
FPDoc Onlineexperiment

TTCache unit

Defines and implements object caches used in the FreeType library.

An object class is a structure layout that encapsulate one given type of data used by the FreeType engine. Each object class is completely described by:

A 'root' or 'leading' structure containing the first important fields of the class. The root structure is always of fixed size. It is implemented as a simple C structure, and may contain several pointers to sub-tables that can be sized and allocated dynamically.

Examples: TFace, TInstance, TGlyph and TExecution_Context (defined in TTObjs).

There is a difference between 'child' pointers and 'peer' pointers. A 'child' pointer points to a sub-table that is owned by the object, while a 'peer' pointer points to any other kind of data the object isn't responsible for. An object class is thus usually a 'tree' of 'child' tables.

Each object class needs a constructor and a destructor. A constructor is a function which receives the address of freshly allocated and zeroed object root structure and 'builds' all the valid child data that must be associated to the object before it becomes 'valid'.

A destructor does the inverse job : given the address of a valid object, it must discards all its child data and zero its main fields (essentially the pointers and array sizes found in the root fields).

Copyright 1996, 1997 by David Turner, Robert Wilhelm, and Werner Lemberg.

Classes and records

TCacherecord
TCache_Classrecord
TList_Elementrecord

Procedures and functions

Cache_Createfunction
Cache_Destroyfunction
Cache_Donefunction
Cache_Newfunction
Element_Doneprocedure
Element_Newfunction
TTCache_Donefunction
TTCache_Initfunction

Types

PCachetype
PCache_Classtype
PList_Elementtype
TConstructorprocedure type
TDestructorprocedure type
TSingle_Listtype

Uses

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.