/[guile]/guile/guile-core/libguile/gc.c
ViewVC logotype

Diff of /guile/guile-core/libguile/gc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.236 by mvo, Fri Oct 4 13:42:43 2002 UTC revision 1.237 by mdj, Mon Dec 9 13:42:58 2002 UTC
# Line 144  scm_i_expensive_validation_check (SCM ce Line 144  scm_i_expensive_validation_check (SCM ce
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  }  }
# Line 249  SCM_DEFINE (scm_set_debug_cell_accesses_ Line 251  SCM_DEFINE (scm_set_debug_cell_accesses_
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
# Line 457  SCM_DEFINE (scm_gc, "gc", 0, 0, 0, Line 459  SCM_DEFINE (scm_gc, "gc", 0, 0, 0,
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  }  }
# Line 475  scm_gc_for_newcell (scm_t_cell_type_stat Line 479  scm_gc_for_newcell (scm_t_cell_type_stat
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);
# Line 519  scm_gc_for_newcell (scm_t_cell_type_stat Line 525  scm_gc_for_newcell (scm_t_cell_type_stat
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  }  }
# Line 540  scm_igc (const char *what) Line 547  scm_igc (const char *what)
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      {      {
# Line 610  scm_igc (const char *what) Line 621  scm_igc (const char *what)
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.
# Line 1011  scm_gc_sweep (void) Line 1024  scm_gc_sweep (void)
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

Legend:
Removed from v.1.236  
changed lines
  Added in v.1.237

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26