Hash

/* Graphics Not Rendered in HTML */ There is a symbol (hash) table for each task. When a sym is not found, the parent task's sym table is checked. All tasks chain back to the Adam task. TempleOS sym tables are implemented with an array of linked-lists. A num is generated from a string by HashStr() to index into the array of linked-lists. Multiple strings can generate the same num, so linked-lists are built. Newer entries overshadow older ones. There are various types of entries. See Hash Entry Types. Symbol Look-up (Used many places including the JIT Compiler and Loader.) 1) Symbol name is hashed by adding and shifting the ASCII of all chars. 2) hash table->body[] array is indexed. 3) Linked-lst is traversed until match of text and type of entry. 4) If not found, hash table->next table is searched. Duplicate entries are allowed -- they overshadow old entries. Address-to-Symbol Look-up (Slow because not important. We could use trees.) 1) FunSeg Cache is scanned. 2) Hash Tables are scanned. CHash Class class CHash CHashTable Class class CHashTable HashAdd Funct Add entry to hash table. HashAddAfter Funct extern U0 (*fp_set_std_palette)(); HashBucketFind Funct Find hash bucket. HashDepthRep Funct Hash table linked-list chain depth report. HashFind Funct Find string in hash table. HashSingleTableFind Funct Find string in single hash table. HashStr Funct Hash a string. HashTableNew Funct New hash table, power-of-two in size.

Hash/Frame

If you require separate global vars for multiple instances of a routine, you can use Frames. See SpriteMeshEd(), ::/Demo/Graphics/Pick3D.HC or Noise(). FramePtr Funct Find entry in task->hash_table, Return user_data. FramePtrAdd Funct Add named value to task->hash_table. FramePtrDel Funct Remove entry and delete. FramePtrSet Funct Find hash entry in task->hash_table. Change user_data0.

Hash/System

CHashAC Class class CHashAC:CHash CHashClass Class class CHashClass:CHashSrcSym CHashDefineStr Class class CHashDefineStr:CHashSrcSym CHashExport Class class CHashExport:CHashSrcSym CHashFun Class class CHashFun:CHashClass CHashGeneric Class class CHashGeneric:CHash CHashGlblVar Class class CHashGlblVar:CHashSrcSym CHashImport Class class CHashImport:CHashSrcSym CHashOpcode Class class CHashOpcode:CHash CHashReg Class class CHashReg:CHash CHashSrcSym Class class CHashSrcSym:CHash FunSegFind Funct See Hash. HashDefineLstAdd Funct Add define list to a hash table. See ::/Adam/DolDoc/DocInit.HC. HashDel Funct Free a std TempleOS system hash entry. HashEntrySize Funct Logical size of a std system hash entry. HashEntrySize2 Funct Memory size of a std system hash entry. HashGenericAdd Funct Add any type to task hash_table, 3 user_data values. HashLstAdd Funct Add a list to a hash table. HashPublic Funct Mark a hash entry as public and HashSrcFileSet(). HashRemDel Funct Remove hash entry and del. Instance must match. HashTableDel Funct Free std system hash table, calling HashDel() on entries. HashTablePurge Funct Eliminate ExportSysSyms that have been usurped. HashTableSize2 Funct Memory size of std system hash table and all entries. HashTypeNum Funct Return bit num of hash type, limited to just types. HashVal Funct Returns most likely desired value. MapFileLoad Funct Load map file so we have src line info. Who Funct Dump hash symbol table. Who23 Funct Dump hash symbol table. Who3 Funct Dump hash symbol table.