Branch: Tag:

2008-05-11

2008-05-11 02:36:00 by Martin Stjernholm <mast@lysator.liu.se>

Implemented visit functions for the visit_thing_fn interface. The gc
check/mark functions are restored to how they were before the
GC_PASS_COUNT_MEMORY stuff.

Rev: src/array.c:1.206
Rev: src/array.h:1.74
Rev: src/constants.c:1.59
Rev: src/constants.h:1.36
Rev: src/mapping.c:1.200
Rev: src/mapping.h:1.67
Rev: src/multiset.c:1.110
Rev: src/multiset.h:1.43
Rev: src/object.c:1.290
Rev: src/object.h:1.95
Rev: src/pike_types.c:1.331
Rev: src/pike_types.h:1.114
Rev: src/program.c:1.691
Rev: src/program.h:1.242
Rev: src/stralloc.c:1.218
Rev: src/stralloc.h:1.103

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: constants.c,v 1.58 2008/04/26 16:07:39 grubba Exp $ + || $Id: constants.c,v 1.59 2008/05/11 02:35:22 mast Exp $   */      #include "global.h"
16:   #include "mapping.h"   #include "pike_error.h"   #include "pike_security.h" + #include "gc.h" +    #include "block_alloc.h"      struct mapping *builtin_constants = 0;
188:    return ret;   }    + void visit_callable (struct callable *c, int action) + { +  switch (action) {   #ifdef PIKE_DEBUG -  +  default: +  Pike_fatal ("Unknown visit action %d.\n", action); +  case VISIT_NORMAL: +  case VISIT_COMPLEX_ONLY: +  break; + #endif +  case VISIT_COUNT_BYTES: +  mc_counted_bytes += sizeof (struct callable); +  break; +  } +  +  if (!(action & VISIT_COMPLEX_ONLY)) { +  visit_type_ref (c->type, REF_TYPE_NORMAL); +  visit_string_ref (c->name, REF_TYPE_NORMAL); +  } +  +  /* Looks like the c->prog isn't refcounted..? */ +  /* visit_program_ref (c->prog, REF_TYPE_NORMAL); */ + } +  + #ifdef PIKE_DEBUG   void present_constant_profiling(void)   {    struct callable_block *b;