CoolFace
Datasetpublic

hschumann2/TempleOS-Source-Code

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes838downloads
Hash.txt50 linesDownload Raw Back to Doc
1 2/* Graphics Not Rendered in HTML */3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29There is a symbol (hash) table for each task.  When a sym is not found, the30parent task's sym table is checked.  All tasks chain back to the Adam task.31 32TempleOS sym tables are implemented with an array of linked-lists.  A num is33generated from a string by HashStr() to index into the array of linked-lists.34Multiple strings can generate the same num, so linked-lists are built.  Newer35entries overshadow older ones.36 37There are various types of entries.  See Hash Entry Types.38 39Symbol Look-up (Used many places including the JIT Compiler and Loader.)401) Symbol name is hashed by adding and shifting the ASCII of all chars.412) hash table->body[] array is indexed.423) Linked-lst is traversed until match of text and type of entry.434) If not found, hash table->next table is searched.44 45Duplicate entries are allowed -- they overshadow old entries.46 47Address-to-Symbol Look-up (Slow because not important. We could use trees.)481) FunSeg Cache is scanned.492) Hash Tables are scanned.50