Diff for /gforth/hash.fs between versions 1.27 and 1.28

version 1.27, 2001/01/28 16:54:55 version 1.28, 2001/09/04 09:17:02
Line 18 Line 18
 \ 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
Line 32 Line 36
   
 \ 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) ;
Line 42  Variable revealed Line 52  Variable revealed
   
 \ 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
Line 134  Defer hash-alloc ( addr -- addr ) Line 144  Defer hash-alloc ( addr -- addr )
   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
   

Removed from v.1.27  
changed lines
  Added in v.1.28


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>