(FILECREATED "12-Dec-85 16:36:48" {ERIS}<PROLOGCORE>PATCH>ALLOCPATCH.;1 1824   

      changes to:  (VARS ALLOCPATCHCOMS)
		   (FNS \ALLOCVIRTUALPAGEBLOCK)

      previous date: "12-Dec-85 16:29:57" {ERIS}<PROLOGCORE>PATCH>ALLOCPATCH.;2)


(* Copyright (c) 1985 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT ALLOCPATCHCOMS)

(RPAQQ ALLOCPATCHCOMS ((FNS \ADVANCE.ARRAY.SEGMENTS)))
(DEFINEQ

(\ADVANCE.ARRAY.SEGMENTS
  [LAMBDA (NXTPAGE)                                          (* bvm: "12-Dec-85 16:18")

          (* * Called when the first 8mb are exhausted, and we want to switch array space into the next area, starting with 
	  page NXTPAGE -- have to first clean up what's left in the old area)


    (PROG (NCELLSLEFT)
	    (SETQ.NOREF \ArrayFrLst2 (COND
			  ((IGEQ [SETQ NCELLSLEFT
				     (IPLUS (UNFOLD (SUB1 (IDIFFERENCE \NxtArrayPage
									     (fetch (POINTER PAGE#)
										of \ArrayFrLst)))
						      CELLSPERPAGE)
					      (IDIFFERENCE CELLSPERPAGE (fetch (POINTER 
										       CELLINPAGE)
									     of \ArrayFrLst]
				   \MinArrayBlockSize)       (* Make the rest of the already allocated array space 
							     into a small block)
			    (\MERGEBACKWARD (\MAKEFREEARRAYBLOCK \ArrayFrLst NCELLSLEFT))
			    (create POINTER
				      PAGE# ← \LeastMDSPage))
			  (T \ArrayFrLst)))
	    [SETQ.NOREF \ARRAYSPACE2 (SETQ.NOREF \ArrayFrLst (create POINTER
								       PAGE# ←(SETQ \NxtArrayPage 
									 NXTPAGE]
                                                             (* Return code to tell \ALLOCBLOCK.NEW to notice the 
							     new arrangement)
	    (RETURN 0])
)
(PUTPROPS ALLOCPATCH COPYRIGHT ("Xerox Corporation" 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (405 1743 (\ADVANCE.ARRAY.SEGMENTS 415 . 1741)))))
STOP