/* Copyright (C) 1990, Digital Equipment Corporation. */ /* All rights reserved. */ /* See the file COPYRIGHT for a full description. */ /* Last modified on Thu Jun 14 03:55:22 1990 by muller */ /* for VAX */ /* This depends on the direction in which the stack grows */ IMPORT char* _ThreadSup__stackLimit; #define CHECKSTACKOVERFLOW \ { char foo; if (&foo <= _ThreadSup__stackLimit) \ _M3Runtime__StackOverflow (); } /* Unfortunately this is not a uniform way to get the beginning of the data section */ IMPORT etext; #define IS_CLOSURE(p) (((char*)p) > (char*)&etext) /* How to check for NIL pointers: NICHECKA and NILCHECKB must evaluate their argument e (a char*) and generate a trap if it is NIL (0). The compiler generates NILCHECKA when there is a future reference to e[0..1023]; otherwise NICHECKB. Thus, if referencing one of the first 1024 bytes of virtual memory causes a trap, NILCHECKA can just evaluate e; the future reference will generate the trap. */ volatile char nil_check_char; #define NILCHECKA(e) nil_check_char = ((char*)(e))[-1]; #define NILCHECKB(e) nil_check_char = ((char*)(e))[-1]; /* The garbage collector needs to know two things: - what is the alignment of pointers in the stacks ? - what is the alignment of objects ? */ /* The following definition expresses in bytes the amount by which the pointer sweeping the stacks to discover pointers to roots have to be advanced. */ #define STACK_INC 4 /* pointers in stacks are word-aligned */ /* The allocator aligns all the structures it allocates to satisify any possble alignment constraint, in the style of malloc. The quantity is expressed in words. */ #define ALIGNMENT 1 /* objects are word aligned */ /* The type 'signed_char' is 'signed char' in ANSI-C, but CC may not like that */ typedef char signed_char;