Skip to content

Commit

Permalink
Allow incremental GC on Cosmo
Browse files Browse the repository at this point in the history
Issue #666 (bdwgc).

This currently works for single-threaded builds or when pthread_atfork
is not used.

* include/private/gcconfig.h [COSMO && (!GC_THREADS || NO_HANDLE_FORK
|| GC_NO_CAN_CALL_ATFORK)] (MPROTECT_VDB): Define; add FIXME item.
* include/private/gcconfig.h [(HAVE_SYS_TYPES_H || !(__CC_ARM || OS2
|| MSWINCE || SN_TARGET_ORBIS || SN_TARGET_PSP2)) && COSMO
&& MPROTECT_VDB && !_GNU_SOURCE] (_GNU_SOURCE): Define (before include
sys/types.h).
* include/private/gcconfig.h [COSMO] (USE_SEGV_SIGACT,
USE_BUS_SIGACT): Define.
* os_dep.c [MPROTECT_VDB && !DARWIN && !MSWIN32 && !MSWINCE && COSMO]
(CODE_OK): Define (to TRUE).
  • Loading branch information
ivmai committed Oct 17, 2024
1 parent 9f35017 commit 4254d96
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions include/private/gcconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,11 @@ extern int _end[];
/* Normally should be defined by configure, etc. */
# define HAVE_PTHREAD_SETNAME_NP_WITH_TID 1
# endif
# if !defined(GC_THREADS) || defined(NO_HANDLE_FORK) \
|| defined(GC_NO_CAN_CALL_ATFORK)
# define MPROTECT_VDB
/* FIXME: otherwise gctest crashes in child */
# endif
#endif /* COSMO */

#ifdef DARWIN
Expand Down Expand Up @@ -2544,6 +2549,9 @@ extern int __end__[];
|| !(defined(__CC_ARM) || defined(OS2) || defined(MSWINCE) \
|| defined(SN_TARGET_ORBIS) || defined(SN_TARGET_PSP2))
EXTERN_C_END
# if defined(COSMO) && defined(MPROTECT_VDB) && !defined(_GNU_SOURCE)
# define _GNU_SOURCE 1
# endif
# include <sys/types.h>
EXTERN_C_BEGIN
#endif /* HAVE_SYS_TYPES_H */
Expand Down Expand Up @@ -2593,12 +2601,12 @@ EXTERN_C_BEGIN
# define SUNOS5SIGS
#endif

#if defined(ANY_BSD) || defined(HAIKU) || defined(HURD) || defined(IRIX5) \
|| defined(OSF1) || defined(SUNOS5SIGS)
#if defined(ANY_BSD) || defined(COSMO) || defined(HAIKU) || defined(HURD) \
|| defined(IRIX5) || defined(OSF1) || defined(SUNOS5SIGS)
# define USE_SEGV_SIGACT
# if defined(IRIX5) && defined(_sigargs) /* Irix 5.x, not 6.x */ \
|| (defined(FREEBSD) && defined(SUNOS5SIGS)) || defined(HPUX) \
|| defined(HURD) || defined(NETBSD)
|| defined(COSMO) || defined(HURD) || defined(NETBSD)
/* We may get SIGBUS. */
# define USE_BUS_SIGACT
# endif
Expand Down
4 changes: 2 additions & 2 deletions os_dep.c
Original file line number Diff line number Diff line change
Expand Up @@ -3311,8 +3311,8 @@ is_header_found_async(const void *p)
# define CODE_OK (si->si_code == 2 /* experimentally determined */)
# elif defined(IRIX5)
# define CODE_OK (si->si_code == EACCES)
# elif defined(AIX) || defined(CYGWIN32) || defined(HAIKU) \
|| defined(HURD) || defined(LINUX)
# elif defined(AIX) || defined(COSMO) || defined(CYGWIN32) \
|| defined(HAIKU) || defined(HURD) || defined(LINUX)
/* Linux: Empirically c.trapno == 14, on IA32, but is that useful? */
/* Should probably consider alignment issues on other architectures. */
# define CODE_OK TRUE
Expand Down

0 comments on commit 4254d96

Please sign in to comment.