Method: (DEALLOCATE-BLOCK T FREE-LIST-HEAP)

Source

(defmethod deallocate-block (block (heap free-list-heap))
  ;; Push the block on the front of its free list.
  (let* ((size (block-size block heap))
         (size-class (size-class size heap)))
    (if (free-list-empty-p size-class heap)
        ;; Let free list start point to the block and vice versa.
        (setf (block-header block heap) (free-list-pointer size-class)
              (free-list-start heap size-class) block)
      ;; Normal case: let free list start point to the block,
      ;; the block to the old block that the free list start pointed to.
      (let ((old-first-block (free-list-start heap size-class)))
        (setf (block-header block heap) old-first-block
              (free-list-start heap size-class) block)))
    ;;
    (initialize-block block size heap)))
Source Context