diff options
author | Karl Williamson <khw@cpan.org> | 2020-03-08 12:29:01 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-03-09 14:57:27 -0600 |
commit | 975d8916e99aadf059b284a824eff315e49a1825 (patch) | |
tree | 826e3c355f78233f955f88d499ec05c7d3f65911 /malloc.c | |
parent | 044d25c73ce10d2b29008b875209d414303ccff7 (diff) | |
download | perl-975d8916e99aadf059b284a824eff315e49a1825.tar.gz |
malloc.c: Fix compiler warnings/error
This needed a const to compile, and there were warnings as well.
Diffstat (limited to 'malloc.c')
-rw-r--r-- | malloc.c | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -1330,8 +1330,9 @@ Perl_malloc(size_t nbytes) MALLOC_UNLOCK; DEBUG_m(PerlIO_printf(Perl_debug_log, - "0x% "UVxf ": (%05lu) malloc %ld bytes\n", - PTR2UV((Malloc_t)(p + CHUNK_SHIFT)), (unsigned long)(PL_an++), + "%p: (%05lu) malloc %ld bytes\n", + (Malloc_t)(p + CHUNK_SHIFT), + (unsigned long)(PL_an++), (long)size)); FILLCHECK_DEADBEEF((unsigned char*)(p + CHUNK_SHIFT), @@ -1679,7 +1680,8 @@ morecore(int bucket) /* It's our first time. Initialize ourselves */ were_called = 1; /* Avoid a loop */ if (!MallocCfg[MallocCfg_skip_cfg_env]) { - char *s = getenv("PERL_MALLOC_OPT"), *t = s, *off; + char *s = getenv("PERL_MALLOC_OPT"), *t = s; + const char *off; const char *opts = PERL_MALLOC_OPT_CHARS; int changed = 0; @@ -2260,8 +2262,9 @@ Perl_dump_mstats(pTHX_ const char *s) for (i = MIN_EVEN_REPORT; i <= buffer.topbucket; i += BUCKETS_PER_POW2) { PerlIO_printf(Perl_error_log, ((i < 8*BUCKETS_PER_POW2 || i == 10*BUCKETS_PER_POW2) - ? " %5"UVuf - : ((i < 12*BUCKETS_PER_POW2) ? " %3"UVuf : " %"UVuf)), + ? " %5" UVuf + : ((i < 12*BUCKETS_PER_POW2) ? " %3" UVuf + : " %" UVuf)), buffer.nfree[i]); } #ifdef BUCKETS_ROOT2 @@ -2279,8 +2282,8 @@ Perl_dump_mstats(pTHX_ const char *s) for (i = MIN_EVEN_REPORT; i <= buffer.topbucket; i += BUCKETS_PER_POW2) { PerlIO_printf(Perl_error_log, ((i < 8*BUCKETS_PER_POW2 || i == 10*BUCKETS_PER_POW2) - ? " %5"IVdf - : ((i < 12*BUCKETS_PER_POW2) ? " %3"IVdf : " %"IVdf)), + ? " %5" IVdf + : ((i < 12*BUCKETS_PER_POW2) ? " %3" IVdf : " %" IVdf)), buffer.ntotal[i] - buffer.nfree[i]); } #ifdef BUCKETS_ROOT2 |