/* Copyright (C) 1990, Digital Equipment Corporation. */ /* All rights reserved. */ /* See the file COPYRIGHT for a full description. */ /* Last modified on Wed Jul 18 01:34:29 1990 by muller */ /* for DS3100 */ /* This depends on the direction in which the stack grows */ extern char* _ThreadSup__stackLimit; #define CHECKSTACKOVERFLOW \ { char foo; if (&foo <= _ThreadSup__stackLimit) \ _M3Runtime__StackOverflow (); } /* This is actually the default value used by the linker */ 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) e; #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 2 /* objects are word aligned */ /* The type 'signed_char' is 'signed char' in ANSI-C, but CC may not like that */ typedef signed char signed_char;