anchor.diff:                                                                   +block-map-writable+
                                                                    +block-map-zero-fill+)))
         (mezzano.supervisor:panic "Insufficient space for garbage collection!"))
  -    ;; TODO: maybe disable dirty bit tracking on gen1 to avoid false positives caused by transport.
  +    ;; Disable dirty bit tracking on gen1.
  +    (mezzano.supervisor:protect-memory-range (logior (dpb +address-generation-1+ +address-generation+ 0)
  +                                                     (ash +address-tag-general+ +address-tag-shift+))
  +                                             *general-area-gen1-limit*
  +                                             (logior +block-map-present+
  +                                                     +block-map-writable+))
  +    (mezzano.supervisor:protect-memory-range (logior (dpb +address-generation-1+ +address-generation+ 0)
  +                                                     (ash +address-tag-cons+ +address-tag-shift+))
  +                                             *cons-area-gen1-limit*
  +                                             (logior +block-map-present+
  +                                                     +block-map-writable+))
       ;; Scan roots.
       ;; All thread stacks.
       (loop
          for thread = mezzano.supervisor::*all-threads* then (mezzano.supervisor::thread-global-next thread)
          until (null thread)
          do (minor-scan-thread thread))
  -    ;; The remembered set (currently everything but gen0. oops).
  -    (minor-scan-range *wired-area-base* (- *wired-area-bump* *wired-area-base*))
  +    ;; The remembered set.
  +    ;; Wired area is scanned unconditionally, dirty bit tracking is not supported.
  +    (minor-scan-wired-range *wired-area-base* (- *wired-area-bump* *wired-area-base*))
       (minor-scan-range *pinned-area-base* (- *pinned-area-bump* *pinned-area-base*))
       (minor-scan-range (logior (ash +address-tag-general+ +address-tag-shift+)
                                 *dynamic-mark-bit*)
  
positive.code: (defun minor-scan-thread (thread)
    (scan-thread thread :minor))
  
  (defun minor-scan-range (start size)
    (loop
       with end = (+ start size)
       with current = start
       until (>= current end)
       do
         (let ((type (ash (memref-unsigned-byte-8 current 0) (- +object-type-shift+))))
           (case type
             (#.+object-tag-cons+
              ;; Scanning a cons represented as a headered object.
              (scavengef (memref-t current 2) :minor)
              (scavengef (memref-t current 3) :minor)
              (incf current 32))
             (#.+object-tag-freelist-entry+
              ;; Skip freelist entries.
              (incf current (* (ash (memref-unsigned-byte-64 current 0)
                                    (- +object-data-shift+))
                               8)))
             (t
              (let ((object (%%assemble-value current +tag-object+)))
                (scan-object object :minor)
                (incf current (* (align-up (object-size object) 2) 8))))))))
  
  (defun minor-scan-cons-range (start size)
    (loop
       for current from start below (+ start size) by +card-size+
       do
  
negative.code:             (scan-object object :minor)
              (incf *scavenge-cons-finger* 16))))
      ;; Collection complete.
      ;; Make sure wired, pinned, gen1, gen2 don't contain gen0 pointers.
      (verify-range *wired-area-base*
                    (- *wired-area-bump* *wired-area-base*)
                    +address-generation-0+)
      (verify-range *pinned-area-base*
                    (- *pinned-area-bump* *pinned-area-base*)
                    +address-generation-0+)
      (verify-range (logior (ash +address-tag-general+ +address-tag-shift+)
                            *dynamic-mark-bit*)
                    *general-area-bump*
                    +address-generation-0+)
      (verify-range (logior (ash +address-tag-general+ +address-tag-shift+)
                            (dpb +address-generation-1+ +address-generation+ 0))
                    *general-area-gen1-bump*
                    +address-generation-0+)
      (verify-cons-range (logior (ash +address-tag-cons+ +address-tag-shift+)
                                 *dynamic-mark-bit*)
                         *cons-area-bump*
                         +address-generation-0+)
      (verify-cons-range (logior (ash +address-tag-cons+ +address-tag-shift+)
                                 (dpb +address-generation-1+ +address-generation+ 0))
                         *cons-area-gen1-bump*
                         +address-generation-0+)
      ;; Clear gen1 dirty bits, there are no objects in gen0.
      (loop
         for i from (logior (ash +address-tag-general+ +address-tag-shift+)
                            (dpb +address-generation-1+ +address-generation+ 0))
         below general-gen1-bump by +card-size+
         do (setf (card-table-dirty-p i) nil))
      (loop
         for i from (logior (ash +address-tag-cons+ +address-tag-shift+)
                            (dpb +address-generation-1+ +address-generation+ 0))
         below cons-gen1-bump by +card-size+
         do (setf (card-table-dirty-p i) nil))
      ;; Trim gen1 down to the bump pointer and tag it for dirty tracking.
      (let ((new-limit (align-up *general-area-gen1-bump* +allocation-minimum-alignment+)))
        (mezzano.supervisor:protect-memory-range (logior (dpb +address-generation-1+ +address-generation+ 0)
  