Merge pull request #2294 from akoeplinger/fix-cygwin
[mono.git] / libgc / include / private / gc_priv.h
index 0e978ea950ec4ef9fde2e84f753ed6d407fe83d1..ab77402e4cd466eb3e5bcc6c82d597a54386fa78 100644 (file)
@@ -371,6 +371,8 @@ void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
 #              define GC_MACH_THREAD_STATE_FLAVOR PPC_THREAD_STATE
 #      elif defined(I386)
 #              define GC_MACH_THREAD_STATE_FLAVOR i386_THREAD_STATE
+#      elif defined(X86_64)
+#              define GC_MACH_THREAD_STATE_FLAVOR x86_THREAD_STATE64
 #      else
 #              define GC_MACH_THREAD_STATE_FLAVOR MACHINE_THREAD_STATE
 #      endif
@@ -401,9 +403,9 @@ void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
 #     define ENABLE_SIGNALS()
 #   else
 #     define DISABLE_SIGNALS() GC_disable_signals()
-       void GC_disable_signals();
+       void GC_disable_signals(void);
 #     define ENABLE_SIGNALS() GC_enable_signals()
-       void GC_enable_signals();
+       void GC_enable_signals(void);
 #   endif
 # endif
 
@@ -423,8 +425,8 @@ void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
 # else
 #   if defined(GC_SOLARIS_THREADS) || defined(GC_WIN32_THREADS) \
        || defined(GC_PTHREADS)
-      void GC_stop_world();
-      void GC_start_world();
+      void GC_stop_world(void);
+      void GC_start_world(void);
 #     define STOP_WORLD() GC_stop_world()
 #     define START_WORLD() GC_start_world()
 #   else
@@ -940,6 +942,7 @@ struct _GC_arrays {
 #   define MAP_SIZE MAP_ENTRIES
 #   define CPP_MAX_OFFSET (OFFSET_TOO_BIG - 1) 
 #   define MAX_OFFSET ((word)CPP_MAX_OFFSET)
+#   define INIT_MAP(map) memset((map), OBJ_INVALID, MAP_SIZE)
     /* The following are used only if GC_all_interior_ptrs != 0 */
 #      define VALID_OFFSET_SZ \
          (CPP_MAX_OFFSET > WORDS_TO_BYTES(CPP_MAXOBJSZ)? \
@@ -982,7 +985,7 @@ struct _GC_arrays {
 #   ifdef SMALL_CONFIG
 #     define MAX_HEAP_SECTS 128                /* Roughly 256MB (128*2048*1K)  */
 #   else
-#     define MAX_HEAP_SECTS 384                /* Roughly 3GB                  */
+#     define MAX_HEAP_SECTS (384+128)          /* Roughly 4GB                  */
 #   endif
 # endif
   struct HeapSect {
@@ -1211,6 +1214,8 @@ extern long GC_large_alloc_warn_suppressed;
   extern GC_bool GC_world_stopped;
 #endif
 
+extern void (*GC_notify_event) GC_PROTO((GC_EventType));
+
 /* Operations */
 # ifndef abs
 #   define abs(x)  ((x) < 0? (-(x)) : (x))
@@ -1451,6 +1456,10 @@ GC_bool GC_is_tmp_root GC_PROTO((ptr_t p));
 void GC_register_dynamic_libraries GC_PROTO((void));
                /* Add dynamic library data sections to the root set. */
 
+void GC_cond_register_dynamic_libraries GC_PROTO((void));
+               /* Remove and reregister dynamic libraries if we're     */
+               /* configured to do that at each GC.                    */
+
 GC_bool GC_register_main_static_data GC_PROTO((void));
                /* We need to register the main data segment.  Returns  */
                /* TRUE unless this is done implicitly as part of       */
@@ -1685,6 +1694,9 @@ void GC_finalize GC_PROTO((void));
                        /* for processing by GC_invoke_finalizers.      */
                        /* Invoked with lock.                           */
 
+void GC_process_togglerefs (void);
+       /*Process the togglerefs before GC starts */
+
 void GC_notify_or_invoke_finalizers GC_PROTO((void));
                        /* If GC_finalize_on_demand is not set, invoke  */
                        /* eligible finalizers. Otherwise:              */
@@ -1839,7 +1851,7 @@ void GC_dump GC_PROTO((void));
 #   ifdef __DMC__
       GC_API void GC_noop(...);
 #   else
-      GC_API void GC_noop();
+      GC_API void GC_noop(void*,...);
 #   endif
 # endif
 
@@ -1928,17 +1940,17 @@ void GC_err_puts GC_PROTO((GC_CONST char *s));
     /* GC_notify_all_builder() is called when GC_fl_builder_count      */
     /* reaches 0.                                                      */
 
-     extern void GC_acquire_mark_lock();
-     extern void GC_release_mark_lock();
-     extern void GC_notify_all_builder();
+     extern void GC_acquire_mark_lock(void);
+     extern void GC_release_mark_lock(void);
+     extern void GC_notify_all_builder(void);
      /* extern void GC_wait_builder(); */
-     extern void GC_wait_for_reclaim();
+     extern void GC_wait_for_reclaim(void);
 
      extern word GC_fl_builder_count;  /* Protected by mark lock.      */
 # endif /* PARALLEL_MARK || THREAD_LOCAL_ALLOC */
 # ifdef PARALLEL_MARK
-     extern void GC_notify_all_marker();
-     extern void GC_wait_marker();
+     extern void GC_notify_all_marker(void);
+     extern void GC_wait_marker(void);
      extern word GC_mark_no;           /* Protected by mark lock.      */
 
      extern void GC_help_marker(word my_mark_no);
@@ -1961,6 +1973,8 @@ void GC_err_puts GC_PROTO((GC_CONST char *s));
        /* SPARC/Linux doesn't properly define SIGPWR in <signal.h>.
         * It is aliased to SIGLOST in asm/signal.h, though.            */
 #      define SIG_SUSPEND SIGLOST
+#    elif defined(NACL)
+#      define SIG_SUSPEND 0
 #    else
        /* Linuxthreads itself uses SIGUSR1 and SIGUSR2.                        */
 #      define SIG_SUSPEND SIGPWR