//routeSwapZone.bcpl

// Routine to cause a new free storage zone to be set up in the swapping buffer

// last modified by McCreight, July 2, 1981 1:57 PM

get "route.defs"

external
[
OverlayNpages

currOverlay
overlayCore
npBiggestOverlay
]

let NewSwapZone(length) be
[
test swapZone eq empty
ifnot CallSwat("Multiple swapZones")
ifso
[
if Usc(256*OverlayNpages(currOverlay)+length,
256*npBiggestOverlay) ge 0 then
CallSwat("swapZone wants overlay’s space")
]
swapZone = InitializeZone(overlayCore+256*npBiggestOverlay-length,
length)
]