-- Misc>UtilitiesImpl.mesa (last edited by Forrest on July 18, 1980 4:05 PM PM)
DIRECTORY
Inline USING [LongCOPY],
MiscPrograms USING [],
Utilities USING [];
UtilitiesImpl: PROGRAM
IMPORTS Inline EXPORTS MiscPrograms, Utilities =
BEGIN
InitializeUtilities: PUBLIC PROC = { -- may be something here someday -- };
-- Move the contents of the size words starting at pSource to the size words starting at pSink
-- Unlike Inline.LongCOPY, overlapping blocks do not cause replication of source words.
LongMove: PUBLIC PROC [pSource: LONG POINTER, size: CARDINAL, pSink: LONG POINTER] =
BEGIN
LP: PROC [p: LONG POINTER] RETURNS [LONG ORDERED POINTER] =
INLINE { RETURN[LOOPHOLE[p]] };
i: CARDINAL;
IF LP[pSink] IN [LP[pSource]..LP[pSource]+size) THEN
FOR i DECREASING IN [0..size) DO (pSink+i)↑ ← (pSource+i)↑ ENDLOOP
ELSE
Inline.LongCOPY[from: pSource, nwords: size, to: pSink]
END;
END.
LOG
Time: April 14, 1980 8:39 AMBy: KnutsenAction: Added InitializeUtilities.
Time: July 17, 1980 6:41 PMBy: ForrestAction: Deleted Page<=>LongPointer ops, which are now INLINE