]> granicus.if.org Git - gc/commitdiff
Allow incremental GC on Cygwin
authorIvan Maidanski <ivmai@mail.ru>
Tue, 2 Apr 2019 22:00:57 +0000 (01:00 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 2 Apr 2019 22:05:08 +0000 (01:05 +0300)
Both GWW- and mprotect-based implementations should work. The first one
works only if the collector is compiled with -D USE_WINALLOC passed to
CFLAGS.

* include/private/gcconfig.h [(I386 || X86_64) && CYGWIN32]
(MPROTECT_VDB): Define.
* include/private/gcconfig.h [(I386 || X86_64) && CYGWIN32
&& USE_WINALLOC] (GWW_VDB): Define.
* include/private/gcconfig.h [(I386 || X86_64) && CYGWIN32 && USE_MMAP]
(NEED_FIND_LIMIT, USE_MMAP_ANON): Do not define if USE_WINALLOC.
* include/private/gcconfig.h [GWW_VDB && !USE_WINALLOC && !CPPCHECK]:
Produce an invalid config error.

include/private/gcconfig.h

index 562c10e57d421a16d47e9418af980e37eaa0aabb..5aa7980ab0a610c3ec34304f162e9cb04d0657cc 100644 (file)
@@ -1548,7 +1548,10 @@ EXTERN_C_BEGIN
 #       define OS_TYPE "CYGWIN32"
 #       define DATASTART ((ptr_t)GC_DATASTART)  /* From gc.h */
 #       define DATAEND   ((ptr_t)GC_DATAEND)
-#       ifdef USE_MMAP
+#       define MPROTECT_VDB
+#       ifdef USE_WINALLOC
+#         define GWW_VDB
+#       elif defined(USE_MMAP)
 #         define NEED_FIND_LIMIT
 #         define USE_MMAP_ANON
 #       endif
@@ -2768,7 +2771,10 @@ EXTERN_C_BEGIN
 #   endif
 #   ifdef CYGWIN32
 #       define OS_TYPE "CYGWIN32"
-#       ifdef USE_MMAP
+#       define MPROTECT_VDB
+#       ifdef USE_WINALLOC
+#         define GWW_VDB
+#       elif defined(USE_MMAP)
 #         define USE_MMAP_ANON
 #       endif
 #   endif
@@ -3288,6 +3294,10 @@ EXTERN_C_BEGIN
 # error Invalid config: PARALLEL_MARK requires GC_THREADS
 #endif
 
+#if defined(GWW_VDB) && !defined(USE_WINALLOC) && !defined(CPPCHECK)
+# error Invalid config: GWW_VDB requires USE_WINALLOC
+#endif
+
 #if (((defined(MSWIN32) || defined(MSWINCE)) && !defined(__GNUC__)) \
         || (defined(MSWIN32) && defined(I386)) /* for Win98 */ \
         || (defined(USE_PROC_FOR_LIBRARIES) && defined(THREADS))) \