develooper Front page | perl.perl5.porters | Postings from September 2018

[perl #133439] Misleading output for calloc while -Dm in effect

From:
Tony Cook via RT
Date:
September 6, 2018 04:06
Subject:
[perl #133439] Misleading output for calloc while -Dm in effect
Message ID:
rt-4.0.24-12831-1536206772-278.133439-15-0@perl.org
On Fri, 10 Aug 2018 06:50:56 -0700, slaven@rezic.de wrote:
> If -Dm is used then calloc() calls are logged like this:
> 
> 0x2cbf90930: (2217022366) calloc 32808 x 32808 bytes
> 
> It looks like approximately 1GB is allocated here. But the actual
> DEBUG_m
> call is the following:
> 
> DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%" UVxf ": (%05ld) calloc %ld
> x %ld
> bytes\n",PTR2UV(ptr),(long)PL_an++,(long)count,(long)total_size));
> 
> so the last number is not the single element size, but the total size
> of the memory allocation.
> 
> Probably the output should look different here, for example
> 
> calloc %ld elements totalling %ld bytes
> 
> or
> 
> calloc %ld x %ld = %ld bytes", ... count, size, total_size
> 
> or so.

Something like the attached?

Tony

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=133439



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About