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.167 2004/09/18 22:02:45 nilsson Exp $ + || $Id: stralloc.c,v 1.168 2004/09/27 21:37:23 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:1811: Inside #if defined(PIKE_RUN_UNLOCKED)
  #ifdef PIKE_RUN_UNLOCKED    {    int h;    bucket_locks=(PIKE_MUTEX_T *)xalloc(sizeof(PIKE_MUTEX_T)*BUCKET_LOCKS);    for(h=0;h<BUCKET_LOCKS;h++) mt_init(bucket_locks + h);    }   #endif    empty_pike_string = make_shared_string("");   }    - #ifdef DEBUG_MALLOC + #ifdef DO_PIKE_CLEANUP   struct shared_string_location *all_shared_string_locations;   #endif         void cleanup_shared_string_table(void)   {    unsigned INT32 e;    struct pike_string *s,*next;       if (empty_pike_string) {    free_string(empty_pike_string);    empty_pike_string = 0;    }    - #if defined(PIKE_DEBUG) && defined(DEBUG_MALLOC) + #ifdef DO_PIKE_CLEANUP    while(all_shared_string_locations)    {    struct shared_string_location *x=all_shared_string_locations;    all_shared_string_locations=x->next;    free_string(x->s);    x->s=0;    }    -  if(verbose_debug_exit) +  if (exit_with_cleanup)    {    INT32 num,size;    count_memory_in_strings(&num,&size);    if(num)    {    fprintf(stderr,"Strings left: %d (%d bytes) (zapped)\n",num,size); -  + #ifdef PIKE_DEBUG    dump_stralloc_strings(); -  + #endif    }    }   #endif       for(e=0;e<htable_size;e++)    {    LOCK_BUCKET(e);    for(s=base_table[e];s;s=next)    {    next=s->next;