2002-12-01
2002-12-01 00:16:55 by Martin Stjernholm <mast@lysator.liu.se>
-
d631b8fc0dc399a2e08d19a4d54b8becafd71eac
(28 lines)
(+15/-13)
[
Show
| Annotate
]
Branch: 7.9
Some debug improvements when the refcount is wrong.
Rev: src/array.c:1.133
Rev: src/iterators.cmod:1.31
Rev: src/mapping.c:1.157
Rev: src/multiset.c:1.60
Rev: src/object.c:1.211
Rev: src/program.c:1.464
Rev: src/stralloc.c:1.150
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.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"
28:
#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 */
934: Inside #if defined(PIKE_DEBUG)
{
#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)
{
946: Inside #if defined(PIKE_DEBUG)
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);