(defmethod heap-info ((heap free-list-heap))
;; Returns the total number of free octets in the heap.
;; As a second value it returns a list with, for each free list
;; that is not empty, a plist with info about that free list.
(let* ((info (loop for size-class below (nr-free-lists heap)
unless (free-list-empty-p size-class heap)
collect (free-list-info size-class heap)))
(total (loop for plist in info
sum (or (getf plist :nr-free-octets) 0))))
(values total info)))
Source Context