ZealOS/Doc/Hash.DD
2020-02-15 14:01:48 -06:00

77 lines
No EOL
2 KiB
Text
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

$WW,1$$SP,"",BI=1$
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 $FG,2$Adam$FG$ task.
TempleOS sym tables are implemented with an array of linked-lists. A num is generated from a string by $LK,"HashStr",A="MN: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 $LK,"Hash Entry Types",A="MN:HTT_EXPORT_SYS_SYM"$.
$FG,5$Symbol Look-up$FG$ (Used many places including the $LK,"JIT Compiler",A="FF:::/Compiler/Lex.HC,HashFind"$ and $LK,"Loader",A="FF:::/Kernel/KLoad.HC,HashFind"$.)
1) Symbol name is $LK,"hashed",A="MN:SYS_HASH_STR"$ by adding and shifting the ASCII of all chars.
2) $LK,"hash table",A="MN:CHashTable"$->body[] array is indexed.
3) Linked-lst is traversed until match of text and type of entry.
4) If not found, $LK,"hash table",A="MN:CHashTable"$->next table is searched.
Duplicate entries are allowed -- they overshadow old entries.
$FG,5$Address-to-Symbol Look-up$FG$ (Slow because not important. We could use trees.)
1) FunSeg Cache is $LK,"scanned",A="MN:FunSegCacheFind"$.
2) Hash Tables are $LK,"scanned",A="MN:FunSegFind"$.
í0CatH_CbshDog_DogÐBirdZ´pxƒ<00>oÊ´Ü>´<@ƒPo
)')?
)?%?
%?%'
%')'
='=?
ÀÐÀ´
ÖÐÖ´
Q'Q?
'?
-'-?
A'A?
'?
&ÐÐ
д
´&´
&´&Ð
:´:Ð
N´NÐ
b´bÐ
v´vÐ
2´2Ð
F´FÐ
Z´ZÐ
´Ð
Ð<00>
<00><00>
<00>Ð
ÐÐ
?
 
 ?
??À&À3)3<00>C