pike.git / src / gc.c

version» Context lines:

pike.git/src/gc.c:23:   #include "constants.h"   #include "interpret.h"   #include "bignum.h"      #include "gc.h"   #include "main.h"   #include <math.h>      #include "block_alloc.h"    - RCSID("$Id: gc.c,v 1.168 2001/07/11 11:24:00 mast Exp $"); + RCSID("$Id: gc.c,v 1.169 2001/07/13 11:26:38 grubba Exp $");      /* Run garbage collect approximately every time    * 20 percent of all arrays, objects and programs is    * garbage.    */      #define GC_CONST 20   #define MIN_ALLOC_THRESHOLD 1000   #define MAX_ALLOC_THRESHOLD 10000000   #define MULTIPLIER 0.9
pike.git/src/gc.c:778:    describe_something( PARENT_INFO((struct object *)a)->parent, t, indent+2,depth-1,    (flags | DESCRIBE_SHORT | DESCRIBE_NO_REFS )    & ~ (DESCRIBE_MEM));    }else{    fprintf(stderr,"%*s**There is no parent (any longer?)\n",indent,"");    }    break;       case T_PROGRAM:    { -  char *tmp; +  struct pike_string *tmp;    INT32 line;    int foo=0;       fprintf(stderr,"%*s**Program id: %ld, flags: %x\n",indent,"",    (long)(p->id),    p->flags);       if(p->flags & PROGRAM_HAS_C_METHODS)    {    fprintf(stderr,"%*s**The program was written in C.\n",indent,"");    } -  tmp=get_program_line(p, &line); -  if(strcmp(tmp, "-")) +  +  tmp = get_program_line(p, &line); +  if(strcmp(tmp->str, "-"))    { -  fprintf(stderr,"%*s**Location: %s:%ld\n",indent,"",tmp,(long)line); +  fprintf(stderr,"%*s**Location: %s:%ld\n", +  indent, "", tmp->str, (long)line); +  free_string(tmp);    foo=1;    break;    } -  +  free_string(tmp);   #if 0    if(!foo && p->num_linenumbers>1 && EXTRACT_UCHAR(p->linenumbers)=='\177')    {    fprintf(stderr,"%*s**From file: %s\n",indent,"",p->linenumbers+1);    foo=1;    }   #endif       if(!foo)    {
pike.git/src/gc.c:2593: Inside #if defined(PIKE_DEBUG)
   if (o->prog && (o->prog->flags & PROGRAM_USES_PARENT) &&    PARENT_INFO(o)->parent &&    !PARENT_INFO(o)->parent->prog &&    get_marker(PARENT_INFO(o)->parent)->flags & GC_LIVE_OBJ)    gc_fatal(o, 0, "GC destructed parent prematurely.\n");   #endif    GC_VERBOSE_DO(    fprintf(stderr, "| Killing %p with %d refs", o, o->refs);    if (o->prog) {    INT32 line; -  char *file = get_program_line (o->prog, &line); -  fprintf(stderr, ", prog %s:%d\n", file, line); +  struct pike_string *file = get_program_line (o->prog, &line); +  fprintf(stderr, ", prog %s:%d\n", file->str, line); +  free_string(file);    }    else fputs(", is destructed\n", stderr);    );    destruct(o);    free_object(o);    gc_free_extra_ref(o);   #ifdef PIKE_DEBUG    destroy_count++;   #endif    debug_really_free_gc_frame(kill_list);