| \ along with this program; if not, write to the Free Software |
\ along with this program; if not, write to the Free Software |
| \ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. |
\ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. |
| |
|
| |
[IFUNDEF] erase |
| |
: erase ( addr len -- ) 0 fill ; |
| |
[THEN] |
| |
|
| [IFUNDEF] allocate |
[IFUNDEF] allocate |
| : reserve-mem here swap allot ; |
: reserve-mem here swap allot ; |
| \ move to a kernel/memory.fs |
\ move to a kernel/memory.fs |
| |
|
| \ compute hash key 15jul94py |
\ compute hash key 15jul94py |
| |
|
| |
has? ec [IF] [IFUNDEF] hash |
| |
: hash ( addr len -- key ) |
| |
over c@ swap 1- IF swap char+ c@ + ELSE nip THEN |
| |
[ Hashlen 1- ] literal and ; |
| |
[THEN] [THEN] |
| |
|
| [IFUNDEF] hash |
[IFUNDEF] hash |
| : hash ( addr len -- key ) |
: hash ( addr len -- key ) |
| hashbits (hashkey1) ; |
hashbits (hashkey1) ; |
| |
|
| \ Memory handling 10oct94py |
\ Memory handling 10oct94py |
| |
|
| Variable HashPointer |
AVariable HashPointer |
| Variable HashIndex |
Variable HashIndex |
| 0 Value HashTable |
0 AValue HashTable |
| |
|
| \ forward declarations |
\ forward declarations |
| 0 Value hashsearch-map |
0 AValue hashsearch-map |
| Defer hash-alloc ( addr -- addr ) |
Defer hash-alloc ( addr -- addr ) |
| |
|
| \ DelFix and NewFix are from bigFORTH 15jul94py |
\ DelFix and NewFix are from bigFORTH 15jul94py |
| IF inithash |
IF inithash |
| ELSE rehashall THEN ; |
ELSE rehashall THEN ; |
| |
|
| \ >rom ?! |
const Create (hashsearch-map) |
| align here ' hash-find A, ' hash-reveal A, ' (rehash) A, ' (rehash) A, |
' hash-find A, ' hash-reveal A, ' (rehash) A, ' (rehash) A, |
| to hashsearch-map |
(hashsearch-map) to hashsearch-map |
| |
|
| \ hash allocate and vocabulary initialization 10oct94py |
\ hash allocate and vocabulary initialization 10oct94py |
| |
|