144 |
else |
else |
145 |
{ |
{ |
146 |
counter = scm_debug_cells_gc_interval; |
counter = scm_debug_cells_gc_interval; |
147 |
|
scm_i_thread_put_to_sleep (); |
148 |
scm_igc ("scm_assert_cell_valid"); |
scm_igc ("scm_assert_cell_valid"); |
149 |
|
scm_i_thread_wake_up (); |
150 |
} |
} |
151 |
} |
} |
152 |
} |
} |
251 |
|
|
252 |
|
|
253 |
|
|
254 |
SCM scm_i_freelist = SCM_EOL; |
scm_t_key scm_i_freelist; |
255 |
SCM scm_i_freelist2 = SCM_EOL; |
scm_t_key scm_i_freelist2; |
256 |
|
|
257 |
|
|
258 |
/* scm_mtrigger |
/* scm_mtrigger |
459 |
#define FUNC_NAME s_scm_gc |
#define FUNC_NAME s_scm_gc |
460 |
{ |
{ |
461 |
SCM_DEFER_INTS; |
SCM_DEFER_INTS; |
462 |
|
scm_i_thread_put_to_sleep (); |
463 |
scm_igc ("call"); |
scm_igc ("call"); |
464 |
|
scm_i_thread_wake_up (); |
465 |
SCM_ALLOW_INTS; |
SCM_ALLOW_INTS; |
466 |
return SCM_UNSPECIFIED; |
return SCM_UNSPECIFIED; |
467 |
} |
} |
479 |
{ |
{ |
480 |
SCM cell; |
SCM cell; |
481 |
|
|
482 |
|
scm_i_thread_put_to_sleep (); |
483 |
|
|
484 |
++scm_ints_disabled; |
++scm_ints_disabled; |
485 |
|
|
486 |
*free_cells = scm_i_sweep_some_segments (freelist); |
*free_cells = scm_i_sweep_some_segments (freelist); |
525 |
|
|
526 |
*free_cells = SCM_FREE_CELL_CDR (cell); |
*free_cells = SCM_FREE_CELL_CDR (cell); |
527 |
|
|
528 |
|
scm_i_thread_wake_up (); |
529 |
|
|
530 |
return cell; |
return cell; |
531 |
} |
} |
547 |
fprintf (stderr,"gc reason %s\n", what); |
fprintf (stderr,"gc reason %s\n", what); |
548 |
|
|
549 |
fprintf (stderr, |
fprintf (stderr, |
550 |
SCM_NULLP (scm_i_freelist) |
SCM_NULLP (*SCM_FREELIST_LOC (scm_i_freelist)) |
551 |
? "*" |
? "*" |
552 |
: (SCM_NULLP (scm_i_freelist2) ? "o" : "m")); |
: (SCM_NULLP (*SCM_FREELIST_LOC (scm_i_freelist2)) ? "o" : "m")); |
553 |
#endif |
#endif |
554 |
|
|
555 |
/* During the critical section, only the current thread may run. */ |
/* During the critical section, only the current thread may run. */ |
556 |
|
#if 0 /* MDJ 021207 <djurfeldt@nada.kth.se> |
557 |
|
Currently, a much larger piece of the GC is single threaded. |
558 |
|
Can we shrink it again? */ |
559 |
SCM_CRITICAL_SECTION_START; |
SCM_CRITICAL_SECTION_START; |
560 |
|
#endif |
561 |
|
|
562 |
if (!scm_root || !scm_stack_base || scm_block_gc) |
if (!scm_root || !scm_stack_base || scm_block_gc) |
563 |
{ |
{ |
621 |
scm_c_hook_run (&scm_after_sweep_c_hook, 0); |
scm_c_hook_run (&scm_after_sweep_c_hook, 0); |
622 |
gc_end_stats (); |
gc_end_stats (); |
623 |
|
|
624 |
|
#if 0 /* MDJ 021207 <djurfeldt@nada.kth.se> */ |
625 |
SCM_CRITICAL_SECTION_END; |
SCM_CRITICAL_SECTION_END; |
626 |
|
#endif |
627 |
|
|
628 |
/* |
/* |
629 |
See above. |
See above. |
1024 |
|
|
1025 |
/* When we move to POSIX threads private freelists should probably |
/* When we move to POSIX threads private freelists should probably |
1026 |
be GC-protected instead. */ |
be GC-protected instead. */ |
1027 |
scm_i_freelist = SCM_EOL; |
*SCM_FREELIST_LOC (scm_i_freelist) = SCM_EOL; |
1028 |
scm_i_freelist2 = SCM_EOL; |
*SCM_FREELIST_LOC (scm_i_freelist2) = SCM_EOL; |
1029 |
} |
} |
1030 |
|
|
1031 |
#undef FUNC_NAME |
#undef FUNC_NAME |