Source
(defmethod expand-heap ((heap heap) block-size)
;; Creates (and initializes) a block of the specified size by expanding
;; the heap. The block is not hooked into the free list yet. Returns
;; the new block (but signals a continuable error if expanding the heap
;; would make it exceed its maximum size.
(let ((new-block (heap-end heap))
(max-size (max-heap-size heap)))
(when (and max-size (> (+ new-block block-size) max-size))
(cerror "Ignore the maximum heap size and expand the heap anyway."
(format nil
"Can't expand the heap with ~D octets: it would grow beyond
the specified maximum heap size of ~D octets."
block-size
max-size)))
;;
(incf (heap-end heap) block-size)
;; Initialize and return the new block.
(initialize-block new-block block-size heap)
new-block))
Source Context