2 * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
4 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
5 * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
7 * Permission is hereby granted to use or copy this program
8 * for any purpose, provided the above notices are retained on all copies.
9 * Permission to modify the code and to distribute modified code is granted,
10 * provided the above notices are retained, and a notice that the code was
11 * modified is included with the above copyright notice.
14 /* Check whether setjmp actually saves registers in jmp_buf. */
15 /* If it doesn't, the generic mark_regs code won't work. */
16 /* Compilers vary as to whether they will put x in a */
17 /* (callee-save) register without -O. The code is */
18 /* contrived such that any decent compiler should put x in */
19 /* a callee-save register with -O. Thus it is */
20 /* recommended that this be run optimized. (If the machine */
21 /* has no callee-save registers, then the generic code is */
22 /* safe, but this will not be noticed by this piece of */
23 /* code.) This test appears to be far from perfect. */
27 #include "private/gc_priv.h"
30 /* GETPAGESIZE() is set to getpagesize() by default, but that */
31 /* doesn't really exist, and the collector doesn't need it. */
32 #define INCL_DOSFILEMGR
34 #define INCL_DOSERRORS
41 if (DosQuerySysInfo(QSV_PAGE_SIZE, QSV_PAGE_SIZE,
42 (void *)result, sizeof(ULONG)) != NO_ERROR) {
43 fprintf(stderr, "DosQuerySysInfo failed\n");
46 return((int)(result[0]));
65 long ps = GETPAGESIZE();
67 register int x = (int)strlen("a"); /* 1, slightly disguised */
71 printf("This appears to be a %s running %s\n", MACH_TYPE, OS_TYPE);
72 if (nested_sp() < (int *)sp) {
73 printf("Stack appears to grow down, which is the default.\n");
74 printf("A good guess for STACKBOTTOM on this machine is 0x%lx.\n",
75 ((unsigned long)sp + ps) & ~(ps-1));
77 printf("Stack appears to grow up.\n");
78 printf("Define STACK_GROWS_UP in gc_private.h\n");
79 printf("A good guess for STACKBOTTOM on this machine is 0x%lx.\n",
80 ((unsigned long)sp + ps) & ~(ps-1));
82 printf("Note that this may vary between machines of ostensibly\n");
83 printf("the same architecture (e.g. Sun 3/50s and 3/80s).\n");
84 printf("On many machines the value is not fixed.\n");
85 printf("A good guess for ALIGNMENT on this machine is %ld.\n",
86 (unsigned long)(&(a.a_b))-(unsigned long)(&a));
88 printf("The following is a very dubious test of one root marking"
90 printf("Results may not be accurate/useful:\n");
91 /* Encourage the compiler to keep x in a callee-save register */
98 printf("Setjmp-based generic mark_regs code probably wont work.\n");
99 printf("But we rarely try that anymore. If you have getcontect()\n");
100 printf("this probably doesn't matter.\n");
102 printf("Setjmp-based register marking code may work.\n");
104 printf("Very strange setjmp implementation.\n");
109 if (y == 1) longjmp(b,1);
110 printf("Some GC internal configuration stuff: \n");
111 printf("\tWORDSZ = %d, ALIGNMENT = %d, GC_GRANULE_BYTES = %d\n",
112 WORDSZ, ALIGNMENT, GC_GRANULE_BYTES);
113 printf("\tUsing one mark ");
114 # if defined(USE_MARK_BYTES)
120 # if defined(MARK_BIT_PER_OBJ)
122 # elif defined(MARK_BIT_PER_GRANULE)
123 printf("granule.\n");
125 # ifdef THREAD_LOCAL_ALLOC
126 printf("Thread local allocation enabled.\n");
128 # ifdef PARALLEL_MARK
129 printf("Parallel marking enabled.\n");