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.287 2007/06/09 15:00:56 mast Exp $ + || $Id: gc.c,v 1.288 2007/06/10 12:41:59 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:113: Inside #if defined(DO_PIKE_CLEANUP)
  int gc_trace = 0, gc_debug = 0;   #ifdef DO_PIKE_CLEANUP   int gc_destruct_everything = 0;   #endif   size_t gc_ext_weak_refs;      static double objects_alloced = 0.0;   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 == PIKE_NO + #ifdef CPU_TIME_MIGHT_NOT_BE_THREAD_LOCAL   cpu_time_t auto_gc_time = 0;   #endif      struct link_frame /* See cycle checking blurb below. */   {    void *data;    struct link_frame *prev; /* Previous frame in the link stack. */    gc_cycle_check_cb *checkfn; /* Function to call to recurse the thing. */    int weak; /* Weak flag to checkfn. */   };
pike.git/src/gc.c:2431: Inside #if defined(DEBUG_MALLOC)
   for (i = 0, l = &sentinel_frame; l != stack_top; i++, l = l->next) {    size_t j;    for (j = 0; j <= i; j++)    if (stack_arr[j] == l->next->cycle_id)    goto cycle_id_ok;    {    struct gc_rec_frame *err = l->next;    fprintf (stderr, "cycle_id for frame %p not earlier on stack (%s).\n",    err, where);    for (l = stack_top; l != &sentinel_frame; l = l->prev) { -  fprintf (stderr, +  fprintf (stderr, " %p%s ", l,    l == beg ? " (beg):" : l == pos ? " (pos):" : ": ");    describe_rec_frame (l);    fputc ('\n', stderr);    }    fatal ("cycle_id for frame %p not earlier on stack (%s).\n", err, where);    }    cycle_id_ok:;    }   }   #endif
pike.git/src/gc.c:3684:   #endif       if(new_threshold < GC_MIN_ALLOC_THRESHOLD)    alloc_threshold = GC_MIN_ALLOC_THRESHOLD;    else if(new_threshold > GC_MAX_ALLOC_THRESHOLD)    alloc_threshold = GC_MAX_ALLOC_THRESHOLD;    else    alloc_threshold = (ALLOC_COUNT_TYPE) new_threshold;       if (!explicit_call && last_gc_time != (cpu_time_t) -1) { - #if CPU_TIME_IS_THREAD_LOCAL == PIKE_YES +  if (cpu_time_is_thread_local)    Pike_interpreter.thread_state->auto_gc_time += last_gc_time; - #elif CPU_TIME_IS_THREAD_LOCAL == PIKE_NO +  else    auto_gc_time += last_gc_time; - #endif +     }       if(GC_VERBOSE_DO(1 ||) gc_trace)    {    char timestr[40];    if (last_gc_time != (cpu_time_t) -1)    sprintf (timestr, ", %ld ms",    (long) (last_gc_time / (CPU_TIME_TICKS / 1000)));    else    timestr[0] = 0;