Source
(defmethod expand-free-list (size-class (heap free-list-heap))
;; Try to find a block that's at least EXPANSION-SIZE big on
;; one of the bigger free lists. If there is such a block,
;; carve it up. If there isn't, expand the heap if possible.
(let ((min-size
(if (< (1+ size-class) (nr-free-lists heap))
(max (expansion-size heap)
;; Make sure we only try bigger free lists than
;; the current one.
(size-class-block-size (1+ size-class) heap))
(expansion-size heap))))
(multiple-value-bind (block size)
(find-block min-size heap)
(unless block
(setq size (max (expansion-size heap)
(size-class-block-size size-class heap))
block (expand-heap heap size)))
(carve-up-block-for-free-list size-class block size heap)
;; Return the first new block.
block)))
Source Context