From 7f4dc52ad4b713c5bdefbf9d9dae024dcdf20dac Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 10 Jan 2012 13:58:14 +0400 Subject: [PATCH] Enable platform-specific disabling of static data scanning (Reworked commit a0347f0 from 'mono_libgc' branch) * include/private/gcconfig.h (GC_DONT_REGISTER_MAIN_STATIC_DATA): Recognize new macro. * include/private/gcconfig.h (DYNAMIC_LOADING): Do not define for Darwin/arm if GC_DONT_REGISTER_MAIN_STATIC_DATA. * misc.c (GC_REGISTER_MAIN_STATIC_DATA): Define to FALSE if GC_DONT_REGISTER_MAIN_STATIC_DATA (and not DYNAMIC_LOADING). --- include/private/gcconfig.h | 4 +++- misc.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index efb93f4..d68b561 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -1955,7 +1955,9 @@ # ifdef DARWIN /* iPhone */ # define OS_TYPE "DARWIN" -# define DYNAMIC_LOADING +# ifndef GC_DONT_REGISTER_MAIN_STATIC_DATA +# define DYNAMIC_LOADING +# endif # define DATASTART ((ptr_t) get_etext()) # define DATAEND ((ptr_t) get_end()) # define STACKBOTTOM ((ptr_t) 0x30000000) diff --git a/misc.c b/misc.c index 63262e1..a26de35 100644 --- a/misc.c +++ b/misc.c @@ -64,6 +64,8 @@ /* We need to register the main data segment. Returns TRUE unless */ /* this is done implicitly as part of dynamic library registration. */ # define GC_REGISTER_MAIN_STATIC_DATA() GC_register_main_static_data() +#elif defined(GC_DONT_REGISTER_MAIN_STATIC_DATA) +# define GC_REGISTER_MAIN_STATIC_DATA() FALSE #else /* Don't unnecessarily call GC_register_main_static_data() in case */ /* dyn_load.c isn't linked in. */ -- 2.7.4