Exemplo n.º 1
0
void AT_collect()
{
  clock_t start, mark, sweep;
  clock_t user;
  FILE *file = gc_f;
  int size;

      /* snapshop*/
  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);
  }
  start = clock();
  mark_phase();
  mark = clock();
  user = mark - start;
  STATS(mark_time, user);

  sweep_phase();
  sweep = clock();
  user = sweep - mark;
  STATS(sweep_time, user);

  if (!silent)
    fprintf(file, "..\n");
}
Exemplo n.º 2
0
Arquivo: gc.c Projeto: jkeiren/muCRL
void AT_collect()
{
  struct tms start, mark, sweep;
  clock_t user;
  FILE *file = gc_f;
  int size;

  /* snapshot*/
  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, "collecting garbage..(%d)",at_gc_count);
    fflush(file);
  }
  times(&start);
  CHECK_UNMARKED_BLOCK(AT_BLOCK);
  CHECK_UNMARKED_BLOCK(AT_OLD_BLOCK);
  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");
  }
}