C2COpsImpl.mesa
Copyright Ó 1993 by Xerox Corporation. All rights reserved.
Christian Jacobi, January 15, 1993 10:46:38 am PST
Christian Jacobi, January 19, 1993 5:19 pm PST
DIRECTORY
C2CBasics USING [CantHappen],
C2CTarget USING [bestAlignment, PointeeBits],
C2COps;
C2COpsImpl:
CEDAR
PROGRAM
IMPORTS C2CBasics, C2CTarget
EXPORTS C2COps =
BEGIN
PlainAccess:
PUBLIC
PROC [start, sz:
INT]
RETURNS [
BOOL] = {
IF sz = 0 THEN RETURN [FALSE];
IF sz#C2CTarget.PointeeBits[sz] THEN RETURN [FALSE];
RETURN [(start MOD MIN[sz, C2CTarget.bestAlignment])=0]
};
MinContainerSize:
PUBLIC PROC [start, sz:
INT]
RETURNS [cs:
INT] = {
IF sz<0 THEN C2CBasics.CantHappen;
IF sz=0 THEN RETURN [-1]; --Convention to be phased out
cs ¬ C2CTarget.PointeeBits[sz];
DO
IF cs>=C2CTarget.bestAlignment THEN RETURN [cs];
IF start/cs = (start+sz-1)/cs --starts and stops in same unit-- THEN RETURN [cs];
cs ¬ cs+cs;
ENDLOOP;
};
END.