gc: remove unnecessary workarounds for old bdwgc versions

This commit is contained in:
Marius Gerbershagen 2020-05-09 20:27:47 +02:00
parent d85326d2a5
commit e0bf0f5ac2
7 changed files with 27 additions and 76 deletions

View file

@ -46,7 +46,7 @@ ECL_USE_DBGHELP_FLAG=0
# Programs used by "make":
#
CC = cl
CFLAGS = -c $(ECL_CFLAGS) -DECL_BUILD -DECL_API="__declspec(dllexport)" -I./ -I../ -I$(srcdir) -I$(top_srcdir)/bdwgc/include -I$(top_srcdir)/bdwgc/include/private -I$(srcdir)/unicode
CFLAGS = -c $(ECL_CFLAGS) -DECL_BUILD -DECL_API="__declspec(dllexport)" -I./ -I../ -I../ecl -I$(srcdir) -I$(srcdir)/unicode
SHELL = /bin/sh
RM = del

21
src/aclocal.m4 vendored
View file

@ -1065,20 +1065,12 @@ if test "${enable_boehm}" = auto -o "${enable_boehm}" = system; then
[], [system_boehm="no"] )
AC_CHECK_LIB( [gc], [GC_register_my_thread],
[], [system_boehm="no"] )
AC_CHECK_LIB( [gc], [GC_set_start_callback],
[], [system_boehm="no"] )
fi
if test "${system_boehm}" = yes; then
AC_CHECK_HEADER([gc.h],[ECL_BOEHM_GC_HEADER='gc.h'],[],[])
if test -z "$ECL_BOEHM_GC_HEADER"; then
AC_CHECK_HEADER([gc/gc.h],[ECL_BOEHM_GC_HEADER='gc/gc.h'],
[system_boehm=no],[])
fi
fi
if test "${system_boehm}" = "yes"; then
AC_CHECK_LIB( [gc], [GC_set_start_callback],
[AC_DEFINE([HAVE_GC_SET_START_CALLBACK], [],
[HAVE_GC_SET_START_CALLBACK])], [] )
else
AC_DEFINE([HAVE_GC_SET_START_CALLBACK], [], [HAVE_GC_SET_START_CALLBACK])
AC_CHECK_HEADER([gc/gc.h],[ECL_BOEHM_GC_HEADER='gc/gc.h'],
[system_boehm=no],[])
fi
AC_MSG_CHECKING( [whether we can use the existing Boehm-Weiser library] )
AC_MSG_RESULT( [${system_boehm}] )
@ -1126,11 +1118,10 @@ if test "${enable_boehm}" = "included"; then
LIBRARIES="${LIBRARIES} ${LIBPREFIX}eclgc.${LIBEXT}"
fi
AC_DEFINE(GBC_BOEHM, [0], [Use Boehm's garbage collector])
else
AC_MSG_ERROR([Unable to configure Boehm-Weiser GC])
fi
fi
if test -z "${ECL_BOEHM_GC_HEADER}"; then
AC_MSG_ERROR([Unable to configure Boehm-Weiser GC])
fi
fi
if test "${enable_gengc}" != "no" ; then
AC_DEFINE([GBC_BOEHM_GENGC], [], [GBC_BOEHM_GENGC])

View file

@ -13,7 +13,7 @@ VPATH = @srcdir@
CC = @CC@
TRUE_CC = $(CC)
CFLAGS = -Wall -Wno-missing-braces -I. -I@true_builddir@ -I$(srcdir) \
-I../ecl/gc -DECL_BUILD -DECL_API -DECL_NO_LEGACY @CPPFLAGS@ @CFLAGS@ \
-I../ecl/ -DECL_BUILD -DECL_API -DECL_NO_LEGACY @CPPFLAGS@ @CFLAGS@ \
@ECL_CFLAGS@ -c
# The following flags could be added and used by GCC

View file

@ -27,32 +27,20 @@
#endif
#ifdef GBC_BOEHM
#include <gc/gc_mark.h>
static void (*GC_old_start_callback)(void) = NULL;
#ifdef HAVE_GC_SET_START_CALLBACK
extern void GC_set_start_callback(void *);
extern void *GC_get_start_callback();
#else
extern void (*GC_start_call_back)(void);
#endif
static void gather_statistics(void);
static void update_bytes_consed(void);
static void ecl_mark_env(struct cl_env_struct *env);
/* We need these prototypes because private/gc.h is not available
* and this interface is not yet exported by BDWGC */
extern void GC_push_all(char *bottom, char *top);
extern void GC_push_conditional(char *bottom, char *top, int all);
extern void GC_set_mark_bit(const void *p);
#ifdef GBC_BOEHM_PRECISE
# if GBC_BOEHM
# undef GBC_BOEHM_PRECISE
# else
# include "gc_typed.h"
# include "gc_mark.h"
# include <gc/gc_typed.h>
# ifdef GBC_BOEHM_OWN_ALLOCATOR
# include "private/gc_priv.h"
# include <gc/private/gc_priv.h>
# endif
# define GBC_BOEHM_OWN_MARKER
# if defined(GBC_BOEHM_OWN_MARKER) || defined(GBC_BOEHM_OWN_ALLOCATOR)
@ -295,13 +283,6 @@ allocate_object_own(register struct ecl_type_information *type_info)
#endif /* GBC_BOEHM_OWN_ALLOCATOR */
#ifdef GBC_BOEHM_OWN_MARKER
#define IGNORABLE_POINTER(obj) (ECL_IMMEDIATE(obj) & 2)
#define GC_MARK_AND_PUSH(obj, msp, lim, src) \
((!IGNORABLE_POINTER(obj) && \
(GC_word)obj >= (GC_word)GC_least_plausible_heap_addr && \
(GC_word)obj <= (GC_word)GC_greatest_plausible_heap_addr)? \
GC_mark_and_push(obj, msp, lim, src) : \
msp)
static struct GC_ms_entry *
cl_object_mark_proc(void *addr, struct GC_ms_entry *msp, struct GC_ms_entry *msl,
@ -1114,13 +1095,8 @@ init_alloc(void)
#endif /* GBC_BOEHM_PRECISE */
old_GC_push_other_roots = GC_push_other_roots;
GC_push_other_roots = stacks_scanner;
#ifdef HAVE_GC_SET_START_CALLBACK
GC_old_start_callback = GC_get_start_callback();
GC_set_start_callback(gather_statistics);
#else
GC_old_start_callback = GC_start_call_back;
GC_start_call_back = (void (*)(void))gather_statistics;
#endif
GC_set_java_finalization(1);
GC_set_oom_fn(out_of_memory);
GC_set_warn_proc(no_warnings);

42
src/configure vendored
View file

@ -6209,26 +6209,6 @@ else
system_boehm="no"
fi
fi
if test "${system_boehm}" = yes; then
ac_fn_c_check_header_mongrel "$LINENO" "gc.h" "ac_cv_header_gc_h" "$ac_includes_default"
if test "x$ac_cv_header_gc_h" = xyes; then :
ECL_BOEHM_GC_HEADER='gc.h'
fi
if test -z "$ECL_BOEHM_GC_HEADER"; then
ac_fn_c_check_header_mongrel "$LINENO" "gc/gc.h" "ac_cv_header_gc_gc_h" "$ac_includes_default"
if test "x$ac_cv_header_gc_gc_h" = xyes; then :
ECL_BOEHM_GC_HEADER='gc/gc.h'
else
system_boehm=no
fi
fi
fi
if test "${system_boehm}" = "yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GC_set_start_callback in -lgc" >&5
$as_echo_n "checking for GC_set_start_callback in -lgc... " >&6; }
if ${ac_cv_lib_gc_GC_set_start_callback+:} false; then :
@ -6266,14 +6246,25 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gc_GC_set_start_callback" >&5
$as_echo "$ac_cv_lib_gc_GC_set_start_callback" >&6; }
if test "x$ac_cv_lib_gc_GC_set_start_callback" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBGC 1
_ACEOF
$as_echo "#define HAVE_GC_SET_START_CALLBACK /**/" >>confdefs.h
LIBS="-lgc $LIBS"
else
system_boehm="no"
fi
else
fi
if test "${system_boehm}" = yes; then
ac_fn_c_check_header_mongrel "$LINENO" "gc/gc.h" "ac_cv_header_gc_gc_h" "$ac_includes_default"
if test "x$ac_cv_header_gc_gc_h" = xyes; then :
ECL_BOEHM_GC_HEADER='gc/gc.h'
else
system_boehm=no
fi
$as_echo "#define HAVE_GC_SET_START_CALLBACK /**/" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can use the existing Boehm-Weiser library " >&5
@ -6324,11 +6315,10 @@ $as_echo "$as_me: Configuring included Boehm GC library:" >&6;}
$as_echo "#define GBC_BOEHM 0" >>confdefs.h
else
as_fn_error $? "Unable to configure Boehm-Weiser GC" "$LINENO" 5
fi
fi
if test -z "${ECL_BOEHM_GC_HEADER}"; then
as_fn_error $? "Unable to configure Boehm-Weiser GC" "$LINENO" 5
fi
fi
if test "${enable_gengc}" != "no" ; then

View file

@ -330,9 +330,6 @@
/* Define to 1 if you have the `fseeko' function. */
#undef HAVE_FSEEKO
/* HAVE_GC_SET_START_CALLBACK */
#undef HAVE_GC_SET_START_CALLBACK
/* Define to 1 if you have the `getcwd' function. */
#undef HAVE_GETCWD

View file

@ -42,9 +42,6 @@
#define ECL_WEAK_HASH
#endif
/* GC_set_start_callback */
#undef HAVE_GC_SET_START_CALLBACK
/*
* SYSTEM FEATURES:
*/