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: stralloc.c,v 1.217 2008/05/03 15:29:26 nilsson Exp $ + || $Id: stralloc.c,v 1.218 2008/05/11 02:36:00 mast Exp $   */      #include "global.h"
2134:    size[0]=size_;   }    - void gc_mark_string_as_referenced (struct pike_string *s) + void visit_string (struct pike_string *s, int action)   { -  if (gc_mark (s)) -  if (Pike_in_gc == GC_PASS_COUNT_MEMORY) -  gc_counted_bytes += memory_in_string (s); +  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 += memory_in_string (s); +  break;    } -  + }      #ifdef PIKE_DEBUG   unsigned gc_touch_all_strings(void)
2162: Inside #if defined(PIKE_DEBUG)
   for(e=0;e<htable_size;e++)    {    struct pike_string *p; -  for(p=base_table[e];p;p=p->next) -  gc_mark_string_as_referenced(p); +  for(p=base_table[e];p;p=p->next) gc_is_referenced(p);    }   }   #endif