X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=malloc.c;h=409eed5ac71c5125ec740e724135b564cc297d8c;hb=23f3589e21445e9141901c2894bc97b457493332;hp=0e6e6420a7c8f455f89a6930a36ae2eeee3a3e2a;hpb=066d1a89330dfaa74b5c19223bbd3a266ca4fab3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/malloc.c b/malloc.c index 0e6e642..409eed5 100644 --- a/malloc.c +++ b/malloc.c @@ -1035,6 +1035,16 @@ extern Malloc_t sbrk(int); #ifndef NO_MALLOC_DYNAMIC_CFG # define PERL_MALLOC_OPT_CHARS "FMfAPGdac" +# ifndef FILL_DEAD_DEFAULT +# define FILL_DEAD_DEFAULT 1 +# endif +# ifndef FILL_ALIVE_DEFAULT +# define FILL_ALIVE_DEFAULT 1 +# endif +# ifndef FILL_CHECK_DEFAULT +# define FILL_CHECK_DEFAULT 1 +# endif + static IV MallocCfg[MallocCfg_last] = { FIRST_SBRK, MIN_SBRK, @@ -1042,9 +1052,9 @@ static IV MallocCfg[MallocCfg_last] = { SBRK_ALLOW_FAILURES, SBRK_FAILURE_PRICE, SBRK_ALLOW_FAILURES * SBRK_FAILURE_PRICE, /* sbrk_goodness */ - 1, /* FILL_DEAD */ - 1, /* FILL_ALIVE */ - 1, /* FILL_CHECK */ + FILL_DEAD_DEFAULT, /* FILL_DEAD */ + FILL_ALIVE_DEFAULT, /* FILL_ALIVE */ + FILL_CHECK_DEFAULT, /* FILL_CHECK */ 0, /* MallocCfg_skip_cfg_env */ 0, /* MallocCfg_cfg_env_read */ 0, /* MallocCfg_emergency_buffer_size */ @@ -1269,8 +1279,6 @@ botch(char *diag, char *s, char *file, int line) goto do_write; else { dTHX; - char linebuf[10]; - if (PerlIO_printf(PerlIO_stderr(), "assertion botched (%s?): %s%s %s:%d\n", diag, s, file, line) != 0) { @@ -1282,8 +1290,16 @@ botch(char *diag, char *s, char *file, int line) write2(" ("); write2(file); write2(":"); - sprintf(linebuf, "%d", line); - write2(linebuf); + { + char linebuf[10]; + char *s = linebuf + sizeof(linebuf) - 1; + int n = line; + *s = 0; + do { + *--s = '0' + (n % 10); + } while (n /= 10); + write2(s); + } write2(")\n"); } PerlProc_abort();