Commits

Moritz Heidkamp  committed bd74fbc

Replace some fixnum type annotations with number

Otherwise it *still* fails on 32 bit with specialization turned on.

  • Participants
  • Parent commits b9615d3

Comments (0)

Files changed (1)

File persistent-hash-map.scm

                           init)))))
         init)))
 
-(: arithmetic-shift-right (fixnum fixnum --> fixnum))
+(: arithmetic-shift-right (number number --> number))
 (define (arithmetic-shift-right n x)
   (arithmetic-shift n (- 0 x)))
 
-(: mask (fixnum fixnum --> fixnum))
+(: mask (number number --> number))
 (define (mask hash shift)
   (bitwise-and (arithmetic-shift-right hash shift) #x01f))
 
-(: bitpos (fixnum fixnum --> fixnum))
+(: bitpos (number number --> number))
 (define (bitpos hash shift)
   (arithmetic-shift 1 (mask hash shift)))
 
 ;; TODO: 64bit compat by doubling hex digits and -56 instead of -24
-(: bit-count (fixnum --> fixnum))
+(: bit-count (number --> number))
 
 ;; (define (bit-count v)
 ;;   (let* ((v (- v (bitwise-and (arithmetic-shift v -1) #x55555555)))
 (define bit-count
   (foreign-lambda int __builtin_popcount unsigned-integer))
 
-(: bitmap-indexed-node-index (fixnum fixnum --> fixnum))
+(: bitmap-indexed-node-index (number number --> number))
 (define (bitmap-indexed-node-index bitmap bit)
   (bit-count (bitwise-and bitmap (- bit 1))))
 
 
 (define-class (bitmap-indexed-node bi-)
   (make-bi-node (edit   : boolean)
-                (bitmap : fixnum)
+                (bitmap : number)
                 (vec    : vector))
   (bi-node? inode)
 
   (define-generic (-kv-reduce f init)
     (inode-kv-reduce (bi-vec inode) f init)))
 
-(: -edit-and-remove-pair (bitmap-indexed-node boolean fixnum fixnum -> bitmap-indexed-node))
+(: -edit-and-remove-pair (bitmap-indexed-node boolean number fixnum -> bitmap-indexed-node))
 
 (define-record-printer (bitmap-indexed-node vnode out)
   (fprintf out "#<bitmap-indexed-node ~S>" (-vec vnode)))
 
 (define-class (hash-collision-node hc-)
   (make-hc-node (edit           : boolean)
-                (collision-hash : fixnum)
-                (count          : fixnum)
+                (collision-hash : number)
+                (count          : number)
                 (vec            : vector))
   (hc-node? inode)
 
   (define-generic (-kv-reduce f init)
     (inode-kv-reduce (hc-vec inode) f init)))
 
-(: -ensure-editable-vector (hash-collision-node boolean fixnum vector -> hash-collision-node))
+(: -ensure-editable-vector (hash-collision-node boolean number vector -> hash-collision-node))
 
 (define-record-printer (hash-collision-node hc-node out)
   (fprintf out "#<hash-collision-node ~S>" (hc-vec hc-node)))
 
 (define-class (vector-node v-)
   (make-v-node (edit  : boolean)
-               (count : fixnum)
+               (count : number)
                (vec   : vector))
   (v-node? inode)
 
 (define-class (transient-hash-map tm-)
   (make-transient-map (edit       : boolean)
                       (root       : node)
-                      (count      : fixnum)
+                      (count      : number)
                       (has-false? : boolean)
                       (false-val  : *))
   (transient-map? self)
             (-inode-lookup (tm-root self) 0 (key-hash k) k not-found)))))
 
 (define-class (persistent-hash-map pm-)
-  (make-map (count      : fixnum)
+  (make-map (count      : number)
             (root       : node)
             (has-false? : boolean)
             (false-val  : *))
 (define map-delete!
   (map-keys-proc delete!))
 
-(: map-size (hash-map -> fixnum))
+(: map-size (hash-map -> number))
 (define map-size
   -count)