else
{
counter = scm_debug_cells_gc_interval;
+ scm_i_thread_put_to_sleep ();
scm_igc ("scm_assert_cell_valid");
+ scm_i_thread_wake_up ();
}
}
}
/*
do nothing
*/
-
+ fprintf (stderr, "\nWARNING: GUILE was not compiled with SCM_DEBUG_CELL_ACCESSES");
scm_remember_upto_here (flag);
return SCM_UNSPECIFIED;
}
\f
-SCM scm_i_freelist = SCM_EOL;
-SCM scm_i_freelist2 = SCM_EOL;
+scm_t_key scm_i_freelist;
+scm_t_key scm_i_freelist2;
/* scm_mtrigger
#define FUNC_NAME s_scm_gc
{
SCM_DEFER_INTS;
+ scm_i_thread_put_to_sleep ();
scm_igc ("call");
+ scm_i_thread_wake_up ();
SCM_ALLOW_INTS;
return SCM_UNSPECIFIED;
}
{
SCM cell;
+ scm_i_thread_put_to_sleep ();
+
++scm_ints_disabled;
*free_cells = scm_i_sweep_some_segments (freelist);
*free_cells = SCM_FREE_CELL_CDR (cell);
+ scm_i_thread_wake_up ();
return cell;
}
fprintf (stderr,"gc reason %s\n", what);
fprintf (stderr,
- SCM_NULLP (scm_i_freelist)
+ SCM_NULLP (*SCM_FREELIST_LOC (scm_i_freelist))
? "*"
- : (SCM_NULLP (scm_i_freelist2) ? "o" : "m"));
+ : (SCM_NULLP (*SCM_FREELIST_LOC (scm_i_freelist2)) ? "o" : "m"));
#endif
/* During the critical section, only the current thread may run. */
+#if 0 /* MDJ 021207 <djurfeldt@nada.kth.se>
+ Currently, a much larger piece of the GC is single threaded.
+ Can we shrink it again? */
SCM_CRITICAL_SECTION_START;
+#endif
if (!scm_root || !scm_stack_base || scm_block_gc)
{
scm_c_hook_run (&scm_after_sweep_c_hook, 0);
gc_end_stats ();
+#if 0 /* MDJ 021207 <djurfeldt@nada.kth.se> */
SCM_CRITICAL_SECTION_END;
+#endif
/*
See above.
void
scm_init_gc ()
{
- SCM after_gc_thunk;
-
-
scm_gc_init_mark ();
scm_after_gc_hook = scm_permanent_object (scm_make_hook (SCM_INUM0));
scm_c_define ("after-gc-hook", scm_after_gc_hook);
- after_gc_thunk = scm_c_make_subr ("%gc-thunk", scm_tc7_subr_0,
- gc_async_thunk);
- gc_async = scm_system_async (after_gc_thunk); /* protected via scm_asyncs */
+ gc_async = scm_c_make_subr ("%gc-thunk", scm_tc7_subr_0,
+ gc_async_thunk);
scm_c_hook_add (&scm_after_gc_c_hook, mark_gc_async, NULL, 0);
/* When we move to POSIX threads private freelists should probably
be GC-protected instead. */
- scm_i_freelist = SCM_EOL;
- scm_i_freelist2 = SCM_EOL;
+ *SCM_FREELIST_LOC (scm_i_freelist) = SCM_EOL;
+ *SCM_FREELIST_LOC (scm_i_freelist2) = SCM_EOL;
}
#undef FUNC_NAME