/* util.c
*
* Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- * 2000, 2001, 2002, 2003, 2004, 2005, by Larry Wall and others
+ * 2000, 2001, 2002, 2003, 2004, 2005, 2006, by Larry Wall and others
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
where = (Malloc_t)((char*)where-sTHX);
size += sTHX;
if (((struct perl_memory_debug_header *)where)->interpreter != aTHX) {
- /* int *nowhere = NULL; *nowhere = 0; */
Perl_croak_nocontext("panic: realloc from wrong pool");
}
# ifdef PERL_POISON
#ifdef PERL_TRACK_MEMPOOL
where = (Malloc_t)((char*)where-sTHX);
if (((struct perl_memory_debug_header *)where)->interpreter != aTHX) {
- /* int *nowhere = NULL; *nowhere = 0; */
Perl_croak_nocontext("panic: free from wrong pool");
}
# ifdef PERL_POISON
}
/* make sure the array is big enough */
- if (PL_my_cxt_size < *index + 1) {
- if (PL_my_cxt_list) {
- while (PL_my_cxt_size < *index + 1)
+ if (PL_my_cxt_size <= *index) {
+ if (PL_my_cxt_size) {
+ while (PL_my_cxt_size <= *index)
PL_my_cxt_size *= 2;
Renew(PL_my_cxt_list, PL_my_cxt_size, void *);
}