Raymond Toy pushed to branch issue-243-weak-pointer-to-static-array at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • src/code/array.lisp
    ... ... @@ -389,47 +389,6 @@
    389 389
               (setf (sys:sap-ref-32 sap (* -2 vm:word-bytes))
    
    390 390
                     (logand header #x7fffffff)))))))
    
    391 391
     
    
    392
    -#+nil
    
    393
    -(defun finalize-static-vectors ()
    
    394
    -  ;; Run down the list of weak-pointers to static vectors.  Look at
    
    395
    -  ;; the static vector and see if vector is marked.  If so, clear the
    
    396
    -  ;; mark, and do nothing.  If the mark is not set, then the vector is
    
    397
    -  ;; free, so free it, and remove this weak-pointer from the list.
    
    398
    -  ;; The mark bit the MSB of the header word.  Look at scavenge in
    
    399
    -  ;; gencgc.c.
    
    400
    -  (when *static-vectors*
    
    401
    -    (when *debug-static-array-p*
    
    402
    -      (let ((*print-array* nil))
    
    403
    -	(format t (intl:gettext "Finalizing static vectors ~S~%") *static-vectors*)))
    
    404
    -    (setf *static-vectors*
    
    405
    -	  (delete-if
    
    406
    -	   #'(lambda (wp)
    
    407
    -	       (let ((vector (weak-pointer-value wp)))
    
    408
    -		 (when vector
    
    409
    -		   (let* ((sap (sys:vector-sap vector))
    
    410
    -			  (header (sys:sap-ref-32 sap (* -2 vm:word-bytes))))
    
    411
    -		     (when *debug-static-array-p*
    
    412
    -		       (format t (intl:gettext "static vector ~A.  header = ~X~%")
    
    413
    -			       vector header))
    
    414
    -		     (cond ((logbitp 31 header)
    
    415
    -			    ;; Clear mark
    
    416
    -			    (setf (sys:sap-ref-32 sap (* -2 vm:word-bytes))
    
    417
    -				  (logand header #x7fffffff))
    
    418
    -			    (when *debug-static-array-p*
    
    419
    -			      (let ((*print-array* nil))
    
    420
    -				(format t (intl:gettext "  static vector ~A in use~%") vector)))
    
    421
    -			    nil)
    
    422
    -			   (t
    
    423
    -			    ;; Mark was clear so free the vector
    
    424
    -			    (when *debug-static-array-p*
    
    425
    -			      (let ((*print-array* nil))
    
    426
    -				(format t (intl:gettext "  Free static vector ~A~%") vector)))
    
    427
    -			    (sys:without-interrupts
    
    428
    -			      (setf (weak-pointer-value wp) nil)
    
    429
    -			      (free-static-vector vector))
    
    430
    -			    t))))))
    
    431
    -	   *static-vectors*))))
    
    432
    -
    
    433 392
     (defun finalize-static-vectors ()
    
    434 393
       ;; Run down the list of weak-pointers to static vectors.  Look at
    
    435 394
       ;; the static vector and see if vector is marked.  If so, clear the