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.149 2002/11/28 19:11:43 mast Exp $ + || $Id: stralloc.c,v 1.150 2002/12/01 00:16:55 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:21:      #include <errno.h>   #include <float.h>   #include <ctype.h>   #include <math.h>      #ifndef HUGE   #define HUGE HUGE_VAL   #endif /*!HUGE*/    - RCSID("$Id: stralloc.c,v 1.149 2002/11/28 19:11:43 mast Exp $"); + RCSID("$Id: stralloc.c,v 1.150 2002/12/01 00:16:55 mast Exp $");      /* #define STRALLOC_USE_PRIMES */      #ifdef STRALLOC_USE_PRIMES      #define SET_HSIZE(X) htable_size=hashprimes[(X)]   #define HMODULO(X) ((X) % htable_size)      #else   
pike.git/src/stralloc.c:927:   PMOD_EXPORT void do_really_free_pike_string(struct pike_string *s)   {    if (s)    really_free_pike_string(s);   }      PMOD_EXPORT void really_free_string(struct pike_string *s)   {   #ifdef PIKE_DEBUG    extern int d_flag; -  if (d_flag) { +     if (s->refs) { -  Pike_fatal("Freeing string with references!\n"); + #ifdef DEBUG_MALLOC +  describe_something(s, T_STRING, 0,2,0, NULL); + #endif +  Pike_fatal("Freeing string with %d references.\n", s->refs);    }    if(d_flag > 2)    {    if(s->next == (struct pike_string *)(ptrdiff_t)-1)    Pike_fatal("Freeing shared string again!\n");       if(((ptrdiff_t)s->next) & 1)    Pike_fatal("Freeing shared string again, memory corrupt or other bug!\n");    } -  } +     if ((s->size_shift < 0) || (s->size_shift > 2)) {    Pike_fatal("Freeing string with bad shift (0x%08x); could it be a type?\n",    s->size_shift);    }   #endif    unlink_pike_string(s);    really_free_pike_string(s);    GC_FREE_SIMPLE_BLOCK(s);   }