/[gcl]/gcl/pcl/pcl_cache.lisp
ViewVC logotype

Diff of /gcl/pcl/pcl_cache.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by camm, Wed Feb 26 22:21:38 2003 UTC revision 1.2 by camm, Sat Nov 27 22:19:35 2004 UTC
# Line 107  Line 107 
107      (setf (cache-vector-lock-count cache-vector) 0))      (setf (cache-vector-lock-count cache-vector) 0))
108    cache-vector)    cache-vector)
109    
110    ;; FIXME 64
111    (defconstant rand-base (- (ash 1 31) 1))
112    
113  (defmacro modify-cache (cache-vector &body body)  (defmacro modify-cache (cache-vector &body body)
114    `(without-interrupts    `(without-interrupts
115       (multiple-value-prog1       (multiple-value-prog1
# Line 114  Line 117 
117         (let ((old-count (cache-vector-lock-count ,cache-vector)))         (let ((old-count (cache-vector-lock-count ,cache-vector)))
118           (declare (type non-negative-fixnum old-count))           (declare (type non-negative-fixnum old-count))
119           (setf (cache-vector-lock-count ,cache-vector)           (setf (cache-vector-lock-count ,cache-vector)
120                 (if (= old-count most-positive-fixnum)                 (if (= old-count rand-base)
121                     1 (the non-negative-fixnum (1+ old-count))))))))                     1 (the non-negative-fixnum (1+ old-count))))))))
122    
123  (deftype field-type ()  (deftype field-type ()
# Line 255  Line 258 
258  ;;; most-positive-fixnum is all-ones.  -- Ram  ;;; most-positive-fixnum is all-ones.  -- Ram
259  ;;;  ;;;
260  (defconstant wrapper-cache-number-length  (defconstant wrapper-cache-number-length
261               (- (integer-length most-positive-fixnum)               (- (integer-length rand-base)
262                  wrapper-cache-number-adds-ok))                  wrapper-cache-number-adds-ok))
263    
264  (defconstant wrapper-cache-number-mask  (defconstant wrapper-cache-number-mask
# Line 270  Line 273 
273      (loop      (loop
274        (setq n        (setq n
275              (logand wrapper-cache-number-mask              (logand wrapper-cache-number-mask
276                      (random most-positive-fixnum *get-wrapper-cache-number*)))                      (random rand-base *get-wrapper-cache-number*)))
277        (unless (zerop n) (return n)))))        (unless (zerop n) (return n)))))
278    
279    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26