summaryrefslogtreecommitdiff
path: root/mark_rts.c
diff options
context:
space:
mode:
authorivmai <ivmai>2010-03-19 20:21:02 +0100
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:53 +0200
commit40d3de7f9affcc48104b505b4903f164f6b672ff (patch)
tree81441f406f6778366fdaf6ec243739edca1a7991 /mark_rts.c
parent7896408d4149347588ed0e36319b53bcea70115b (diff)
2010-03-19 Ivan Maidanski <ivmai@mail.ru> (really Dave Korn)
* dyn_load.c (GC_get_next_stack, GC_cond_add_roots): Define for Cygwin as well as other win32 targets. * dyn_load.c (GC_wnt): Define to constant true. * dyn_load.c (GC_register_dynamic_libraries): Define for Cygwin as well as other win32 targets. * mark_rts.c (rt_hash, GC_roots_present, add_roots_to_index): Don't define for Cygwin, as on other win32. * mark_rts.c (GC_add_roots_inner, GC_clear_roots): Handle on Cygwin as for other win32 targets. * mark_rts.c (GC_rebuild_root_index): Don't declare on Cygwin, as other win32. * mark_rts.c (GC_remove_tmp_roots): Do declare on Cygwin as on other win32. * mark_rts.c (GC_remove_roots, GC_remove_roots_inner): Don't declare on Cygwin as on other win32. * mark_rts.c (GC_is_tmp_root): Do declare on Cygwin when !NO_DEBUGGING, as on other win32 targets. * mark_rts.c (GC_cond_register_dynamic_libraries): Handle on Cygwin as for other win32 targets. * os_dep.c (GC_setpagesize): Handle on Cygwin as on other win32. * os_dep.c (GC_get_main_stack_base): Don't declare on Cygwin, as other win32. * os_dep.c (GC_sysinfo): Declare on Cygwin, as other win32. * os_dep.c (GC_win32_get_mem): Declare on Cygwin, as on other Win32, but call GC_unix_get_mem instead of GlobalAlloc. * os_dep.c (GC_win32_free_heap): Declare on Cygwin (as empty). * ptr_chck.c (GC_is_visible): Register dynamic libraries on Cygwin as on other win32 platforms. * win32_threads.c (GC_get_next_stack): Define on Cygwin as well as for dynamic loading targets. * include/private/gc_priv.h (GC_INNER): Don't try to use visibility on Cygwin which does not support it. * include/private/gc_priv.h (struct roots): Don't declare r_next member on Cygwin as on other windows hosts. * include/private/gc_priv.h (LOG_RT_SIZE, RT_SIZE): Don't define likewise. * include/private/gc_priv.h (struct _GC_arrays): Do declare _heap_bases[] member and don't declare _root_index likewise. * include/private/gc_priv.h (GC_heap_bases): Do define likewise. * include/private/gc_priv.h (_SYSTEM_INFO): Do forward-declare likewise. * include/private/gc_priv.h (GC_sysinfo): Do declare extern likewise. * include/private/gcconfig.h (GC_win32_get_mem, GET_MEM): Do prototype on Cygwin as other win32 platforms.
Diffstat (limited to 'mark_rts.c')
-rw-r--r--mark_rts.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/mark_rts.c b/mark_rts.c
index 377be44..c47e17a 100644
--- a/mark_rts.c
+++ b/mark_rts.c
@@ -24,7 +24,7 @@
struct roots {
ptr_t r_start;
ptr_t r_end;
-# if !defined(MSWIN32) && !defined(MSWINCE)
+# if !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32)
struct roots * r_next;
# endif
GC_bool r_tmp;
@@ -83,7 +83,7 @@ static int n_root_sets = 0;
}
#endif /* !THREADS */
-#if !defined(MSWIN32) && !defined(MSWINCE)
+#if !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32)
/*
# define LOG_RT_SIZE 6
# define RT_SIZE (1 << LOG_RT_SIZE) -- Power of 2, may be != MAX_ROOT_SETS
@@ -131,7 +131,7 @@ static int n_root_sets = 0;
p -> r_next = GC_root_index[h];
GC_root_index[h] = p;
}
-#endif /* !MSWIN32 */
+#endif /* !MSWIN32 && !MSWINCE && !CYGWIN32 */
GC_INNER word GC_root_size = 0;
@@ -162,7 +162,7 @@ void GC_add_roots_inner(ptr_t b, ptr_t e, GC_bool tmp)
GC_ASSERT(b <= e);
if (b == e) return; /* nothing to do? */
-# if defined(MSWIN32) || defined(MSWINCE)
+# if defined(MSWIN32) || defined(MSWINCE) || defined(CYGWIN32)
/* Spend the time to ensure that there are no overlapping */
/* or adjacent intervals. */
/* This could be done faster with e.g. a */
@@ -231,7 +231,7 @@ void GC_add_roots_inner(ptr_t b, ptr_t e, GC_bool tmp)
GC_static_roots[n_root_sets].r_start = (ptr_t)b;
GC_static_roots[n_root_sets].r_end = (ptr_t)e;
GC_static_roots[n_root_sets].r_tmp = tmp;
-# if !defined(MSWIN32) && !defined(MSWINCE)
+# if !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32)
GC_static_roots[n_root_sets].r_next = 0;
add_roots_to_index(GC_static_roots + n_root_sets);
# endif
@@ -250,7 +250,7 @@ GC_API void GC_CALL GC_clear_roots(void)
roots_were_cleared = TRUE;
n_root_sets = 0;
GC_root_size = 0;
-# if !defined(MSWIN32) && !defined(MSWINCE)
+# if !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32)
{
int i;
for (i = 0; i < RT_SIZE; i++) GC_root_index[i] = 0;
@@ -269,7 +269,7 @@ STATIC void GC_remove_root_at_pos(int i)
n_root_sets--;
}
-#if !defined(MSWIN32) && !defined(MSWINCE)
+#if !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32)
STATIC void GC_rebuild_root_index(void)
{
int i;
@@ -281,7 +281,7 @@ STATIC void GC_remove_root_at_pos(int i)
#endif
#if defined(DYNAMIC_LOADING) || defined(MSWIN32) || defined(MSWINCE) \
- || defined(PCR)
+ || defined(PCR) || defined(CYGWIN32)
/* Internal use only; lock held. */
STATIC void GC_remove_tmp_roots(void)
{
@@ -294,13 +294,13 @@ STATIC void GC_remove_tmp_roots(void)
i++;
}
}
-# if !defined(MSWIN32) && !defined(MSWINCE)
+# if !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32)
GC_rebuild_root_index();
# endif
}
#endif
-#if !defined(MSWIN32) && !defined(MSWINCE)
+#if !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32)
STATIC void GC_remove_roots_inner(ptr_t b, ptr_t e);
GC_API void GC_CALL GC_remove_roots(void *b, void *e)
@@ -331,9 +331,10 @@ STATIC void GC_remove_tmp_roots(void)
}
GC_rebuild_root_index();
}
-#endif /* !defined(MSWIN32) && !defined(MSWINCE) */
+#endif /* !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32) */
-#if (defined(MSWIN32) || defined(MSWINCE)) && !defined(NO_DEBUGGING)
+#if (defined(MSWIN32) || defined(MSWINCE) || defined(CYGWIN32)) \
+ && !defined(NO_DEBUGGING)
/* Not used at present (except for, may be, debugging purpose). */
/* Workaround for the OS mapping and unmapping behind our back: */
/* Is the address p in one of the temporary static root sections? */
@@ -355,7 +356,7 @@ STATIC void GC_remove_tmp_roots(void)
}
return(FALSE);
}
-#endif /* MSWIN32 || MSWINCE */
+#endif /* MSWIN32 || MSWINCE || CYGWIN32 */
GC_INNER ptr_t GC_approx_sp(void)
{
@@ -700,7 +701,7 @@ STATIC void GC_push_gc_structures(void)
GC_INNER void GC_cond_register_dynamic_libraries(void)
{
# if defined(DYNAMIC_LOADING) || defined(MSWIN32) || defined(MSWINCE) \
- || defined(PCR)
+ || defined(CYGWIN32) || defined(PCR)
GC_remove_tmp_roots();
if (!GC_no_dls) GC_register_dynamic_libraries();
# else