Changeset 3639

Show
Ignore:
Timestamp:
07/25/08 15:13:02 (4 months ago)
Author:
ksprotte
Message:

allocate-m2s-for-sale uses again the allocate-cache with exact matches

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/projects/bos/m2/allocation.lisp

    r3617 r3639  
    196196  (warn "activating ~S" area) 
    197197  (setf (slot-value area 'active-p) t) 
    198   (bos.m2.allocation-cache::rebuild-cache) 
     198  (bos.m2.allocation-cache::rebuild-allocation-cache) 
    199199  area) 
    200200 
     
    202202  (warn "deactivating ~S" area) 
    203203  (setf (slot-value area 'active-p) nil) 
    204   (bos.m2.allocation-cache::rebuild-cache) 
     204  (bos.m2.allocation-cache::rebuild-allocation-cache) 
    205205  area) 
    206206 
     
    359359   list of N m2 instances or NIL if the requested amount cannot be 
    360360   allocated." 
    361   (dolist (area (active-allocation-areas)) 
    362     (when (<= n (allocation-area-free-m2s area)) 
    363       (let ((m2s (allocate-in-area area n))) 
    364         (when m2s 
    365           (return-from allocate-m2s-for-sale m2s))))) 
    366   (dolist (area (inactive-nonempty-allocation-areas)) 
    367     (when (<= n (allocation-area-free-m2s area)) 
    368       (let ((m2s (allocate-in-area area n))) 
    369         (when m2s 
    370           (activate-allocation-area area) 
    371           (return-from allocate-m2s-for-sale m2s)))))) 
     361  (or (bos.m2.allocation-cache:find-exact-match n :remove t) 
     362      (dolist (area (active-allocation-areas)) 
     363        (when (<= n (allocation-area-free-m2s area)) 
     364          (let ((m2s (allocate-in-area area n))) 
     365            (when m2s 
     366              (return m2s))))) 
     367      (dolist (area (inactive-nonempty-allocation-areas)) 
     368        (when (<= n (allocation-area-free-m2s area)) 
     369          (let ((m2s (allocate-in-area area n))) 
     370            (when m2s 
     371              (activate-allocation-area area) 
     372              (return m2s))))))) 
    372373 
    373374(defgeneric return-contract-m2s (m2s)