From 57812764a1367e2cc6cdb9e410e7a0b870d6ac10 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 2 Apr 2019 23:37:33 +0300 Subject: [PATCH] Remove unused STACK_GRAN macro definitions (code refactoring) * include/private/gcconfig.h [I386 && CYGWIN32] (STACK_GRAN): Remove macro redefinition. * include/private/gcconfig.h [(ARM32 || M32R) && LINUX && LINUX_STACKBOTTOM] (STACK_GRAN): Likewise. * os_dep.c [!STACKBOTTOM] (GC_get_main_stack_base): Define STACKBOTTOM_ALIGNMENT_M1 macro only if HEURISTIC1. --- include/private/gcconfig.h | 9 ++------- os_dep.c | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index 3a61ed64..562c10e5 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -913,6 +913,7 @@ EXTERN_C_BEGIN # endif # define STACK_GRAN 0x1000000 + # ifdef M68K # define MACH_TYPE "M68K" # define ALIGNMENT 2 @@ -1547,8 +1548,6 @@ EXTERN_C_BEGIN # 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 # ifdef USE_MMAP # define NEED_FIND_LIMIT # define USE_MMAP_ANON @@ -2207,7 +2206,7 @@ EXTERN_C_BEGIN # define DATASTART ((ptr_t)((((word)(etext) + 0x3fffff) & ~0x3fffff) \ + 0x10000)) # endif -# ifdef DGUX +# ifdef DGUX # define OS_TYPE "DGUX" ptr_t GC_SysVGetDataStart(size_t, ptr_t); # define DATASTART GC_SysVGetDataStart(0x10000, (ptr_t)etext) @@ -2369,8 +2368,6 @@ EXTERN_C_BEGIN # ifdef LINUX # define OS_TYPE "LINUX" # define LINUX_STACKBOTTOM -# undef STACK_GRAN -# define STACK_GRAN 0x10000000 # if !defined(GC_LINUX_THREADS) || !defined(REDIRECT_MALLOC) # define MPROTECT_VDB # endif @@ -2567,8 +2564,6 @@ EXTERN_C_BEGIN # ifdef LINUX # define OS_TYPE "LINUX" # define LINUX_STACKBOTTOM -# undef STACK_GRAN -# define STACK_GRAN 0x10000000 # define DYNAMIC_LOADING # define SEARCH_FOR_DATA_START extern int _end[]; diff --git a/os_dep.c b/os_dep.c index 875eb4b1..248b23db 100644 --- a/os_dep.c +++ b/os_dep.c @@ -1247,8 +1247,8 @@ GC_INNER size_t GC_page_size = 0; # ifdef STACKBOTTOM result = STACKBOTTOM; # else -# define STACKBOTTOM_ALIGNMENT_M1 ((word)STACK_GRAN - 1) # ifdef HEURISTIC1 +# define STACKBOTTOM_ALIGNMENT_M1 ((word)STACK_GRAN - 1) # ifdef STACK_GROWS_DOWN result = (ptr_t)(((word)GC_approx_sp() + STACKBOTTOM_ALIGNMENT_M1) & ~STACKBOTTOM_ALIGNMENT_M1); -- 2.40.0