... |
... |
@@ -374,40 +374,20 @@ |
374
|
374
|
sys:system-area-pointer))
|
375
|
375
|
(sys:int-sap addr)))))
|
376
|
376
|
|
377
|
|
-(defun clear-static-vector-mark ()
|
378
|
|
- ;; Run down the list of weak pointers to static vectors. For each
|
379
|
|
- ;; vector, clear the mark.
|
380
|
|
- (dolist (wp *static-vectors*)
|
381
|
|
- (let ((vector (weak-pointer-value wp)))
|
382
|
|
- ;; The value should never be NIL here?
|
383
|
|
- (when vector
|
384
|
|
- (let* ((sap (sys:vector-sap vector))
|
385
|
|
- (header (sys:sap-ref-32 sap (* -2 vm:word-bytes))))
|
386
|
|
- (when *debug-static-array-p*
|
387
|
|
- (format t (intl:gettext "static vector ~A. header = ~X~%")
|
388
|
|
- vector header))
|
389
|
|
- (setf (sys:sap-ref-32 sap (* -2 vm:word-bytes))
|
390
|
|
- (logand header #x7fffffff)))))))
|
391
|
|
-
|
392
|
377
|
(defun finalize-static-vectors ()
|
393
|
|
- ;; Run down the list of weak-pointers to static vectors. Look at
|
394
|
|
- ;; the static vector and see if vector is marked. If so, clear the
|
395
|
|
- ;; mark, and do nothing. If the mark is not set, then the vector is
|
396
|
|
- ;; free, so free it, and remove this weak-pointer from the list.
|
397
|
|
- ;; The mark bit the MSB of the header word. Look at scavenge in
|
398
|
|
- ;; gencgc.c.
|
|
378
|
+ ;; Run down the list of weak-pointers to static vectors and remove
|
|
379
|
+ ;; any weak pointers that have been broken.
|
399
|
380
|
(when *static-vectors*
|
400
|
381
|
(when *debug-static-array-p*
|
401
|
382
|
(let ((*print-array* nil))
|
402
|
383
|
(format t (intl:gettext "Finalizing static vectors ~S~%") *static-vectors*)))
|
403
|
|
- ;; Remove any weak pointers that whose value is NIL. The
|
|
384
|
+ ;; Remove any weak pointers that have been broken. The
|
404
|
385
|
;; corresponding static array has been freed by GC.
|
405
|
386
|
(setf *static-vectors*
|
406
|
|
- (delete-if-not #'weak-pointer-value *static-vectors*))))
|
|
387
|
+ (delete-if-not #'(lambda (wp)
|
|
388
|
+ (nth-value 1 (weak-pointer-value wp)))
|
|
389
|
+ *static-vectors*))))
|
407
|
390
|
|
408
|
|
-;; Clear the mark bit of all of static vectors before GC
|
409
|
|
-#+nil
|
410
|
|
-(pushnew 'clear-static-vector-mark *before-gc-hooks*)
|
411
|
391
|
;; Clean up any unreferenced static vectors after GC has run.
|
412
|
392
|
(pushnew 'finalize-static-vectors *after-gc-hooks*)
|
413
|
393
|
|