示例#1
0
文件: gc.c 项目: bmmoore/sglr-server
void sweep_phase() 
{
  int size;

  for(size=MIN_TERM_SIZE; size<MAX_TERM_SIZE; size++) {
    at_freelist[size] = NULL;
  }
  old_bytes_in_young_blocks_after_last_major = 0;
  old_bytes_in_old_blocks_after_last_major = 0;

  /* Warning: freelist[size] is empty*/
  /* Warning: do not sweep fresh promoted block*/
  major_sweep_phase_old();
  major_sweep_phase_young();
  CHECK_UNMARKED_BLOCK(at_blocks);
  CHECK_UNMARKED_BLOCK(at_old_blocks);
}
示例#2
0
文件: gc.c 项目: jkeiren/muCRL
void sweep_phase() 
{
  int size;

  for(size=MIN_TERM_SIZE; size<AT_getMaxTermSize(); size++) {
    terminfo[size].at_freelist = NULL;
  }
  old_bytes_in_young_blocks_after_last_major = 0;
  old_bytes_in_old_blocks_after_last_major = 0;

  /* Warning: freelist[size] is empty*/
  /* Warning: do not sweep fresh promoted block*/
  major_sweep_phase_old();
  major_sweep_phase_young();
  CHECK_UNMARKED_BLOCK(AT_BLOCK);
  CHECK_UNMARKED_BLOCK(AT_OLD_BLOCK);
}
示例#3
0
文件: gc.c 项目: jkeiren/muCRL
void AT_collect_minor()
{
  struct tms start, mark, sweep;
  clock_t user;
  FILE *file = gc_f;
  int size;
  
    /* snapshop*/
  for(size=MIN_TERM_SIZE; size<AT_getMaxTermSize(); size++) {
    TermInfo* ti = &terminfo[size];
    ti->nb_live_blocks_before_last_gc = ti->at_nrblocks;
    ti->nb_reclaimed_blocks_during_last_gc=0;
    ti->nb_reclaimed_cells_during_last_gc=0;
  }
  
  at_gc_count++;
  if (!silent)
  {
    fprintf(file, "young collecting garbage..(%d)",at_gc_count);
    fflush(file);
  }
  times(&start);
  CHECK_UNMARKED_BLOCK(AT_BLOCK);
  CHECK_UNMARKED_BLOCK(AT_OLD_BLOCK);
    /*nb_cell_in_stack=0;*/
  mark_phase_young();
    /*fprintf(stderr,"AT_collect_young: nb_cell_in_stack = %d\n",nb_cell_in_stack++);*/
  times(&mark);
  user = mark.tms_utime - start.tms_utime;
  STATS(mark_time, user);

  minor_sweep_phase_young();
  CHECK_UNMARKED_BLOCK(AT_BLOCK);
  CHECK_UNMARKED_BLOCK(AT_OLD_BLOCK);

  times(&sweep);
  user = sweep.tms_utime - mark.tms_utime;
  STATS(sweep_time, user);

  if (!silent)
    fprintf(file, "..\n");
}
示例#4
0
文件: gc.c 项目: bmmoore/sglr-server
void AT_collect()
{
  struct tms start, mark, sweep;
  clock_t user;
  FILE *file = gc_f;
  int size;

  /* snapshot*/
  for(size=MIN_TERM_SIZE; size<MAX_TERM_SIZE; size++) {
    nb_live_blocks_before_last_gc[size] = at_nrblocks[size];
    nb_reclaimed_blocks_during_last_gc[size]=0;
    nb_reclaimed_cells_during_last_gc[size]=0;
  }
  
  at_gc_count++;
  if (!silent)
  {
    fprintf(file, "collecting garbage..(%d)",at_gc_count);
    fflush(file);
  }
  times(&start);
  CHECK_UNMARKED_BLOCK(at_blocks);
  CHECK_UNMARKED_BLOCK(at_old_blocks);
  mark_phase();
  times(&mark);
  user = mark.tms_utime - start.tms_utime;
  STATS(mark_time, user);

  sweep_phase();
  
  times(&sweep);
  user = sweep.tms_utime - mark.tms_utime;
  STATS(sweep_time, user);

  if (!silent) {
    fprintf(file, "..\n");
  }
}