]> granicus.if.org Git - gc/commitdiff
Enable platform-specific disabling of static data scanning
authorIvan Maidanski <ivmai@mail.ru>
Tue, 10 Jan 2012 09:58:14 +0000 (13:58 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 10 Jan 2012 09:58:14 +0000 (13:58 +0400)
(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
misc.c

index efb93f435baa893c180791a88febea358c6040a8..d68b56115ef105bad7e3660a864d7cd9c40440f1 100644 (file)
 #   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 63262e1e6afc6358a18a97d2553872d974410792..a26de350fd095279549083aece19d1cd48628274 100644 (file)
--- 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.                                        */