]> granicus.if.org Git - gc/commitdiff
Remove unused STACK_GRAN macro definitions
authorIvan Maidanski <ivmai@mail.ru>
Tue, 2 Apr 2019 20:37:33 +0000 (23:37 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 2 Apr 2019 20:37:33 +0000 (23:37 +0300)
(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
os_dep.c

index 3a61ed645f950d804bcba8d2b0d64e375f0f2fe7..562c10e57d421a16d47e9418af980e37eaa0aabb 100644 (file)
@@ -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[];
index 875eb4b1dc60241e93917bace5fbb28ecf9b051b..248b23dbab057e5b666e7af102ff473a183dddeb 100644 (file)
--- 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);