pike.git / src / gc.c

version» Context lines:

pike.git/src/gc.c:1:   /*   || 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.332 2009/11/11 20:05:06 mast Exp $ + || $Id: gc.c,v 1.333 2009/11/11 20:22:19 mast Exp $   */      #include "global.h"      struct callback *gc_evaluator_callback=0;      #include "array.h"   #include "multiset.h"   #include "mapping.h"   #include "object.h"
pike.git/src/gc.c:4054: Inside #if defined(PIKE_DEBUG)
   size++;       push_constant_text ("max_free_extra_frames");    push_int64 (DO_NOT_WARN ((INT64) tot_max_free_extra_frames));    size++;   #endif       f_aggregate_mapping(size * 2);   }    - /*! @decl int implicit_gc_real_time() + /*! @decl int implicit_gc_real_time (void|int nsec)    *! @belongs Pike    *!    *! Returns the total amount of real time that has been spent in -  *! implicit GC runs, in nanoseconds. +  *! implicit GC runs. The time is normally returned in microseconds, +  *! but if the optional argument @[nsec] is nonzero it's returned in +  *! nanoseconds.    *!    *! @seealso    *! @[Debug.gc_status]    */   void f_implicit_gc_real_time (INT32 args)   { -  +  int nsec = args && !UNSAFE_IS_ZERO (Pike_sp - args);    pop_n_elems (args); -  +  if (nsec) {    push_int64 (auto_gc_real_time);   #ifndef LONG_CPU_TIME    push_int (1000000000 / CPU_TIME_TICKS);    o_multiply();   #endif    } -  +  else { + #if CPU_TIME_TICKS_LOW > 1000000 +  push_int64 (auto_gc_real_time / (CPU_TIME_TICKS / 1000000)); + #else +  push_int64 (auto_gc_real_time); +  push_int (1000000 / CPU_TIME_TICKS); +  o_multiply(); + #endif +  } + }      void dump_gc_info(void)   {    fprintf(stderr,"Current number of things : %d\n",num_objects);    fprintf(stderr,"Allocations since last gc : "PRINT_ALLOC_COUNT_TYPE"\n",    num_allocs);    fprintf(stderr,"Threshold for next gc : "PRINT_ALLOC_COUNT_TYPE"\n",    alloc_threshold);    fprintf(stderr,"Projected current garbage : %f\n",    objects_freed * (double) num_allocs / (double) alloc_threshold);