ProcessStackCheckImpl.mesa
Copyright Ó 1992, 1993 by Xerox Corporation. All rights reserved.
Russ Atkinson (RRA) October 9, 1992 1:28 pm PDT
Michael Plass, September 3, 1993 4:26 pm PDT
DIRECTORY ProcessStackCheck;
ProcessStackCheckImpl: CEDAR PROGRAM
EXPORTS ProcessStackCheck
= BEGIN
XRStackPushTest: PROC [bytes: INT] RETURNS [BOOL] = TRUSTED MACHINE CODE {
Returns TRUE if it appears to be OK to push an additional number of bytes on the stack. Returns FALSE if the stack might be exceeded.
"<xr/Threads.h>.XR←StackPushTest";
};
StackPushTest: PUBLIC PROC [bytes: INT] RETURNS [BOOL] = {
Note: In version 4�.X of PCR (the first version that implements XR←StackPushTest), the sense of the result is inverted from what we advertise (and from what Threads.h advertises). To insulate ourselves against the time when this bug is fixed, we do the compare against XRStackPushTest[0] to get our result.
RETURN [XRStackPushTest[bytes] = XRStackPushTest[0]];
};
END.