Function: MAKE-CBUFFER-POOL

Documentation

make-cbuffer-pool creates a priority-pool using the length of buffers as priority... Largest Buffers have highest priority

Source

(defun make-cbuffer-pool ()
  "make-cbuffer-pool creates a priority-pool using the length
   of buffers as priority... Largest Buffers have highest priority"
  (let* ((pool (make-priority-pool :key-fn #'cbuffer-length
				   :comparator (build-comparator #'= :< #'>)))
	 (std-add-strategie (pool-add-strategie pool)))
    (setf (pool-add-strategie pool)
	  (lambda (obj store)
	    (when (and *use-cbuffer-pool*
		       (< (pool-count pool) *cbuffer-pool-max-size*)
		       (>= (cbuffer-length obj)
			   *cbuffer-pool-min-buffer-size*)
		       (<= (cbuffer-length obj)
			   *cbuffer-pool-max-buffer-size*))
	      (funcall std-add-strategie obj store))))
    pool))
Source Context