Branch: Tag:

2003-02-08

2003-02-08 17:12:27 by Martin Stjernholm <mast@lysator.liu.se>

Exclude the time spent in the gc from the measurements returned by
gethrvtime.

Rev: src/builtin_functions.c:1.469
Rev: src/gc.c:1.200
Rev: src/gc.h:1.98
Rev: src/threads.c:1.200
Rev: src/threads.h:1.122

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: gc.c,v 1.199 2003/02/01 15:43:50 mast Exp $ + || $Id: gc.c,v 1.200 2003/02/08 17:12:27 mast Exp $   */      #include "global.h"
32:      #include "block_alloc.h"    - RCSID("$Id: gc.c,v 1.199 2003/02/01 15:43:50 mast Exp $"); + RCSID("$Id: gc.c,v 1.200 2003/02/08 17:12:27 mast Exp $");      int gc_enabled = 1;   
196:   static double objects_freed = 0.0;   static double gc_time = 0.0, non_gc_time = 0.0;   static cpu_time_t last_gc_end_time = 0; + #if CPU_TIME_IS_THREAD_LOCAL == NO + cpu_time_t auto_gc_time = 0; + #endif      /* These are only collected for the sake of gc_status. */   static double last_garbage_ratio = 0.0;
2904:       alloc_threshold = (ptrdiff_t)new_threshold;    +  if (!explicit_call) { + #if CPU_TIME_IS_THREAD_LOCAL == YES +  OBJ2THREAD(Pike_interpreter.thread_id)->auto_gc_time += last_gc_time; + #elif CPU_TIME_IS_THREAD_LOCAL == NO +  auto_gc_time += last_gc_time; + #endif +  } +     if(GC_VERBOSE_DO(1 ||) gc_trace)    {    if (last_gc_time)