📄 gcconfig.h
字号:
# define DYNAMIC_LOADING
# endif
extern char etext[];
extern char * GC_FreeBSDGetDataStart();
# define DATASTART GC_FreeBSDGetDataStart(0x1000, &etext)
# endif
# ifdef NETBSD
# define ALIGNMENT 4
# define OS_TYPE "NETBSD"
# define HEURISTIC2
extern char etext[];
# define DATASTART GC_data_start
# define DYNAMIC_LOADING
# endif
# ifdef AIX
# define OS_TYPE "AIX"
# undef ALIGNMENT /* in case it's defined */
# ifdef IA64
# undef IA64
/* DOB: some AIX installs stupidly define IA64 in */
/* /usr/include/sys/systemcfg.h */
# endif
# ifdef __64BIT__
# define ALIGNMENT 8
# define CPP_WORDSZ 64
# define STACKBOTTOM ((ptr_t)0x1000000000000000)
# else
# define ALIGNMENT 4
# define CPP_WORDSZ 32
# define STACKBOTTOM ((ptr_t)((ulong)&errno))
# endif
# define USE_MMAP
# define USE_MMAP_ANON
/* From AIX linker man page:
_text Specifies the first location of the program.
_etext Specifies the first location after the program.
_data Specifies the first location of the data.
_edata Specifies the first location after the initialized data
_end or end Specifies the first location after all data.
*/
extern int _data[], _end[];
# define DATASTART ((ptr_t)((ulong)_data))
# define DATAEND ((ptr_t)((ulong)_end))
extern int errno;
# define DYNAMIC_LOADING
/* For really old versions of AIX, this may have to be removed. */
# endif
# ifdef NOSYS
# define ALIGNMENT 4
# define OS_TYPE "NOSYS"
extern void __end[], __dso_handle[];
# define DATASTART (__dso_handle) /* OK, that's ugly. */
# define DATAEND (__end)
/* Stack starts at 0xE0000000 for the simulator. */
# undef STACK_GRAN
# define STACK_GRAN 0x10000000
# define HEURISTIC1
# endif
# endif
# ifdef VAX
# define MACH_TYPE "VAX"
# define ALIGNMENT 4 /* Pointers are longword aligned by 4.2 C compiler */
extern char etext[];
# define DATASTART ((ptr_t)(etext))
# ifdef BSD
# define OS_TYPE "BSD"
# define HEURISTIC1
/* HEURISTIC2 may be OK, but it's hard to test. */
# endif
# ifdef ULTRIX
# define OS_TYPE "ULTRIX"
# define STACKBOTTOM ((ptr_t) 0x7fffc800)
# endif
# endif
# ifdef SPARC
# define MACH_TYPE "SPARC"
# if defined(__arch64__) || defined(__sparcv9)
# define ALIGNMENT 8
# define CPP_WORDSZ 64
# define ELF_CLASS ELFCLASS64
# else
# define ALIGNMENT 4 /* Required by hardware */
# define CPP_WORDSZ 32
# endif
/* Don't define USE_ASM_PUSH_REGS. We do use an asm helper, but */
/* not to push the registers on the mark stack. */
# ifdef SOLARIS
# define OS_TYPE "SOLARIS"
extern int _etext[];
extern int _end[];
extern ptr_t GC_SysVGetDataStart(size_t, ptr_t);
# define DATASTART GC_SysVGetDataStart(0x10000, (ptr_t)_etext)
# define DATAEND (_end)
# if !defined(USE_MMAP) && defined(REDIRECT_MALLOC)
# define USE_MMAP
/* Otherwise we now use calloc. Mmap may result in the */
/* heap interleaved with thread stacks, which can result in */
/* excessive blacklisting. Sbrk is unusable since it */
/* doesn't interact correctly with the system malloc. */
# endif
# ifdef USE_MMAP
# define HEAP_START (ptr_t)0x40000000
# else
# define HEAP_START DATAEND
# endif
# define PROC_VDB
/* HEURISTIC1 reportedly no longer works under 2.7. */
/* HEURISTIC2 probably works, but this appears to be preferable. */
/* Apparently USRSTACK is defined to be USERLIMIT, but in some */
/* installations that's undefined. We work around this with a */
/* gross hack: */
# include <sys/vmparam.h>
# ifdef USERLIMIT
/* This should work everywhere, but doesn't. */
# define STACKBOTTOM USRSTACK
# else
# define HEURISTIC2
# endif
# include <unistd.h>
# define GETPAGESIZE() sysconf(_SC_PAGESIZE)
/* getpagesize() appeared to be missing from at least one */
/* Solaris 5.4 installation. Weird. */
# define DYNAMIC_LOADING
# endif
# ifdef DRSNX
# define OS_TYPE "DRSNX"
extern ptr_t GC_SysVGetDataStart(size_t, ptr_t);
extern int etext[];
# define DATASTART GC_SysVGetDataStart(0x10000, (ptr_t)etext)
# define MPROTECT_VDB
# define STACKBOTTOM ((ptr_t) 0xdfff0000)
# define DYNAMIC_LOADING
# endif
# ifdef LINUX
# define OS_TYPE "LINUX"
# ifdef __ELF__
# define DYNAMIC_LOADING
# else
Linux Sparc/a.out not supported
# endif
extern int _end[];
extern int _etext[];
# define DATAEND (_end)
# define SVR4
extern ptr_t GC_SysVGetDataStart(size_t, ptr_t);
# ifdef __arch64__
# define DATASTART GC_SysVGetDataStart(0x100000, (ptr_t)_etext)
# else
# define DATASTART GC_SysVGetDataStart(0x10000, (ptr_t)_etext)
# endif
# define LINUX_STACKBOTTOM
# endif
# ifdef OPENBSD
# define OS_TYPE "OPENBSD"
# define STACKBOTTOM ((ptr_t) 0xf8000000)
extern int etext[];
# define DATASTART ((ptr_t)(etext))
# endif
# ifdef NETBSD
# define OS_TYPE "NETBSD"
# define HEURISTIC2
# ifdef __ELF__
# define DATASTART GC_data_start
# define DYNAMIC_LOADING
# else
extern char etext[];
# define DATASTART ((ptr_t)(etext))
# endif
# endif
# ifdef FREEBSD
# define OS_TYPE "FREEBSD"
# define SIG_SUSPEND SIGUSR1
# define SIG_THR_RESTART SIGUSR2
# define FREEBSD_STACKBOTTOM
# ifdef __ELF__
# define DYNAMIC_LOADING
# endif
extern char etext[];
extern char edata[];
extern char end[];
# define NEED_FIND_LIMIT
# define DATASTART ((ptr_t)(&etext))
# define DATAEND (GC_find_limit (DATASTART, TRUE))
# define DATASTART2 ((ptr_t)(&edata))
# define DATAEND2 ((ptr_t)(&end))
# endif
# endif
# ifdef I386
# define MACH_TYPE "I386"
# if defined(__LP64__) || defined(_WIN64)
# error This should be handled as X86_64
# else
# define CPP_WORDSZ 32
# define ALIGNMENT 4
/* Appears to hold for all "32 bit" compilers */
/* except Borland. The -a4 option fixes */
/* Borland. */
/* Ivan Demakov: For Watcom the option is -zp4. */
# endif
# ifdef SEQUENT
# define OS_TYPE "SEQUENT"
extern int etext[];
# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
# define STACKBOTTOM ((ptr_t) 0x3ffff000)
# endif
# ifdef BEOS
# define OS_TYPE "BEOS"
# include <OS.h>
# define GETPAGESIZE() B_PAGE_SIZE
extern int etext[];
# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
# endif
# ifdef SOLARIS
# define OS_TYPE "SOLARIS"
extern int _etext[], _end[];
extern ptr_t GC_SysVGetDataStart(size_t, ptr_t);
# define DATASTART GC_SysVGetDataStart(0x1000, (ptr_t)_etext)
# define DATAEND (_end)
/* # define STACKBOTTOM ((ptr_t)(_start)) worked through 2.7, */
/* but reportedly breaks under 2.8. It appears that the stack */
/* base is a property of the executable, so this should not break */
/* old executables. */
/* HEURISTIC2 probably works, but this appears to be preferable. */
# include <sys/vm.h>
# define STACKBOTTOM USRSTACK
/* At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. */
/* It appears to be fixed in 2.8 and 2.9. */
# ifdef SOLARIS25_PROC_VDB_BUG_FIXED
# define PROC_VDB
# endif
# define DYNAMIC_LOADING
# if !defined(USE_MMAP) && defined(REDIRECT_MALLOC)
# define USE_MMAP
/* Otherwise we now use calloc. Mmap may result in the */
/* heap interleaved with thread stacks, which can result in */
/* excessive blacklisting. Sbrk is unusable since it */
/* doesn't interact correctly with the system malloc. */
# endif
# ifdef USE_MMAP
# define HEAP_START (ptr_t)0x40000000
# else
# define HEAP_START DATAEND
# endif
# endif
# ifdef SCO
# define OS_TYPE "SCO"
extern int etext[];
# define DATASTART ((ptr_t)((((word) (etext)) + 0x3fffff) \
& ~0x3fffff) \
+((word)etext & 0xfff))
# define STACKBOTTOM ((ptr_t) 0x7ffffffc)
# endif
# ifdef SCO_ELF
# define OS_TYPE "SCO_ELF"
extern int etext[];
# define DATASTART ((ptr_t)(etext))
# define STACKBOTTOM ((ptr_t) 0x08048000)
# define DYNAMIC_LOADING
# define ELF_CLASS ELFCLASS32
# endif
# ifdef DGUX
# define OS_TYPE "DGUX"
extern int _etext, _end;
extern ptr_t GC_SysVGetDataStart(size_t, ptr_t);
# define DATASTART GC_SysVGetDataStart(0x1000, (ptr_t)(&_etext))
# define DATAEND (&_end)
# define STACK_GROWS_DOWN
# define HEURISTIC2
# include <unistd.h>
# define GETPAGESIZE() sysconf(_SC_PAGESIZE)
# define DYNAMIC_LOADING
# ifndef USE_MMAP
# define USE_MMAP
# endif /* USE_MMAP */
# define MAP_FAILED (void *) -1
# ifdef USE_MMAP
# define HEAP_START (ptr_t)0x40000000
# else /* USE_MMAP */
# define HEAP_START DATAEND
# endif /* USE_MMAP */
# endif /* DGUX */
# ifdef LINUX
# define OS_TYPE "LINUX"
# define LINUX_STACKBOTTOM
# if 0
# define HEURISTIC1
# undef STACK_GRAN
# define STACK_GRAN 0x10000000
/* STACKBOTTOM is usually 0xc0000000, but this changes with */
/* different kernel configurations. In particular, systems */
/* with 2GB physical memory will usually move the user */
/* address space limit, and hence initial SP to 0x80000000. */
# endif
# if !defined(GC_LINUX_THREADS) || !defined(REDIRECT_MALLOC)
# define MPROTECT_VDB
# else
/* We seem to get random errors in incremental mode, */
/* possibly because Linux threads is itself a malloc client */
/* and can't deal with the signals. */
# endif
# define HEAP_START (ptr_t)0x1000
/* This encourages mmap to give us low addresses, */
/* thus allowing the heap to grow to ~3GB */
# ifdef __ELF__
# define DYNAMIC_LOADING
# ifdef UNDEFINED /* includes ro data */
extern int _etext[];
# define DATASTART ((ptr_t)((((word) (_etext)) + 0xfff) & ~0xfff))
# endif
# include <features.h>
# if defined(__GLIBC__) && __GLIBC__ >= 2
# define SEARCH_FOR_DATA_START
# else
extern char **__environ;
# define DATASTART ((ptr_t)(&__environ))
/* hideous kludge: __environ is the first */
/* word in crt0.o, and delimits the start */
/* of the data segment, no matter which */
/* ld options were passed through. */
/* We could use _etext instead, but that */
/* would include .rodata, which may */
/* contain large read-only data tables */
/* that we'd rather not scan. */
# endif
extern int _end[];
# define DATAEND (_end)
# else
extern int etext[];
# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
# endif
# ifdef USE_I686_PREFETCH
/* FIXME: Thus should use __builtin_prefetch, but we'll leave that */
/* for the next rtelease. */
# define PREFETCH(x) \
__asm__ __volatile__ (" prefetchnta %0": : "m"(*(char *)(x)))
/* Empirically prefetcht0 is much more effective at reducing */
/* cache miss stalls for the targetted load instructions. But it */
/* seems to interfere enough with other cache traffic that the net */
/* result is worse than prefetchnta. */
# if 0
/* Using prefetches for write seems to have a slight negative */
/* impact on performance, at least for a PIII/500. */
# define PREFETCH_FOR_WRITE(x) \
__asm__ __volatile__ (" prefetcht0 %0": : "m"(*(char *)(x)))
# endif
# endif
# ifdef USE_3DNOW_PREFETCH
# define PREFETCH(x) \
__asm__ __volatile__ (" prefetch %0": : "m"(*(char *)(x)))
# define PREFETCH_FOR_WRITE(x) \
__asm__ __volatile__ (" prefetchw %0": : "m"(*(char *)(x)))
# endif
# endif
# ifdef CYGWIN32
# define OS_TYPE "CYGWIN32"
# define DATASTART ((ptr_t)GC_DATASTART) /* From gc.h */
# define DATAEND ((ptr_t)GC_DATAEND)
# undef STACK_GRAN
# define STACK_GRAN 0x10000
# define HEURISTIC1
# endif
# ifdef OS2
# define OS_TYPE "OS2"
/* STACKBOTTOM and DATASTART are handled specially in */
/* os_dep.c. OS2 actually has the right */
/* system call! */
# define DATAEND /* not needed */
# endif
# ifdef MSWIN32
# define OS_TYPE "MSWIN32"
/* STACKBOTTOM and DATASTART are handled specially in */
/* os_dep.c. */
# if !defined(__WATCOMC__)
# define MPROTECT_VDB
/* We also avoided doing this in the past with GC_WIN32_THREADS */
/* Hopefully that's fixed. */
# endif
# if _MSC_VER >= 1300 /* .NET, i.e. > VisualStudio 6 */
# define GWW_VDB
# endif
# define DATAEND /* not needed */
# endif
# ifdef MSWINCE
# define OS_TYPE "MSWINCE"
# define DATAEND /* not needed */
# endif
# ifdef DJGPP
# define OS_TYPE "DJGPP"
# include "stubinfo.h"
extern int etext[];
extern int _stklen;
extern int __djgpp_stack_limit;
# define DATASTART ((ptr_t)((((word) (etext)) + 0x1ff) & ~0x1ff))
/* # define STACKBOTTOM ((ptr_t)((word) _stubinfo + _stubinfo->size \
+ _stklen)) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -