Branch: Tag:

1999-05-02

1999-05-02 08:13:05 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

more debug and fixed a memory leak in interpret.c

Rev: src/backend.c:1.41
Rev: src/backend.h:1.7
Rev: src/block_alloc.h:1.11
Rev: src/block_alloc_h.h:1.4
Rev: src/builtin_functions.c:1.168
Rev: src/callback.c:1.17
Rev: src/callback.h:1.8
Rev: src/configure.in:1.281
Rev: src/constants.c:1.18
Rev: src/dmalloc.h:1.11
Rev: src/error.c:1.35
Rev: src/error.h:1.36
Rev: src/gc.c:1.42
Rev: src/gc.h:1.22
Rev: src/interpret.c:1.122
Rev: src/interpret.h:1.31
Rev: src/interpreter.h:1.5
Rev: src/modules/call_out/call_out.c:1.27
Rev: src/modules/files/file.c:1.152
Rev: src/modules/system/system.c:1.70
Rev: src/pike_memory.c:1.37
Rev: src/program.c:1.123
Rev: src/signal_handler.c:1.129
Rev: src/stralloc.c:1.59
Rev: src/threads.c:1.93

5:   \*/   /**/   #include "global.h" - RCSID("$Id: interpret.c,v 1.121 1999/04/17 13:48:47 grubba Exp $"); + RCSID("$Id: interpret.c,v 1.122 1999/05/02 08:11:43 hubbe Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"
186: Inside #if defined(PIKE_DEBUG)
   if(!spcb)    {    spcb=add_gc_callback(gc_check_stack_callback,0,0); +  dmalloc_accept_leak(spcb);    }    }   #endif
790:    {    struct program *p;    struct reference *ref; -  struct pike_frame *new_frame=alloc_pike_frame(); +  struct pike_frame *new_frame;    struct identifier *function;       if(fun<0)
804:    check_mark_stack(256);    check_c_stack(8192);    +  new_frame=alloc_pike_frame(); +  debug_malloc_touch(new_frame); +    #ifdef PIKE_DEBUG    if(d_flag>2) do_debug();   #endif
914:    switch(function->identifier_flags & (IDENTIFIER_FUNCTION | IDENTIFIER_CONSTANT))    {    case IDENTIFIER_C_FUNCTION: +  debug_malloc_touch(fp);    fp->num_args=args;    new_frame->num_locals=args;    check_threads_etc();
923:    case IDENTIFIER_CONSTANT:    {    struct svalue *s=fp->context.prog->constants+function->func.offset; +  debug_malloc_touch(fp);    if(s->type == T_PROGRAM)    {    struct object *tmp;
939:       case 0:    { +  debug_malloc_touch(fp);    if(sp-save_sp-args<=0)    {    /* Create an extra svalue for tail recursion style call */
1109:   {    JMP_BUF tmp;    struct svalue *expendible=fp->expendible; +  debug_malloc_touch(fp);    if(SETJMP(tmp))    {    *sp=throw_value;
1328:   #endif       while(fp) -  { -  struct pike_frame *tmp=fp; -  fp=tmp->next; -  tmp->next=0; -  free_pike_frame(tmp); -  } +  POP_PIKE_FRAME();      #ifdef PIKE_DEBUG    for(e=0;e<BACKLOG;e++)
1372:   void really_clean_up_interpret(void)   {   #ifdef DO_PIKE_CLEANUP + #if 0 +  struct pike_frame_block *p; +  int e; +  for(p=pike_frame_blocks;p;p=p->next) +  for(e=0;e<128;e++) +  debug_malloc_dump_references( p->x + e); + #endif    free_all_pike_frame_blocks();   #endif   }