pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.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: 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"   #include "stralloc.h"   #include "pike_macros.h"   #include "dynamic_buffer.h"   #include "pike_macros.h"   #include "pike_memory.h"   #include "pike_error.h"   #include "gc.h"
pike.git/src/stralloc.c:2127:    UNLOCK_BUCKET(e);    }   #ifdef PIKE_DEBUG    if(num_strings != num_)    Pike_fatal("Num strings is wrong! %d!=%d.\n",num_strings, num_);   #endif    num[0]=num_;    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)   {    unsigned INT32 e;    unsigned n = 0;    if (!base_table) return 0;    for(e=0;e<htable_size;e++)    {    struct pike_string *p;
pike.git/src/stralloc.c:2155: Inside #if defined(PIKE_DEBUG)
   return n;   }      void gc_mark_all_strings(void)   {    unsigned INT32 e;    if(!base_table) return;    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      struct pike_string *next_pike_string (struct pike_string *s)   {    struct pike_string *next = s->next;    if (!next) {    size_t h = s->hval;    do {