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

[perl #121904] array each iterator storage is inefficient

From:
bulk88 via RT
Date:
June 12, 2018 23:08
Subject:
[perl #121904] array each iterator storage is inefficient
Message ID:
rt-4.0.24-5260-1528844892-1676.121904-15-0@perl.org
On Fri, 10 Nov 2017 20:35:28 -0800, zefram@fysh.org wrote:
> There's a simpler way to make this more efficient.  mg_len is nowadays of
> type SSize_t, so Perl_av_iter_p() should use mg_len for storage whenever
> IV is of that size, not only when IV is 32 bits.  Implemented as commit
> 4803e7f74216e2e7d916ba267af33207459d1c8b.
> 
> In principle AV iterators ought to be of type SSize_t, and thus *always*
> storable as mg_len.  But Perl_av_iter_p() is in the public API with
> its IV* return type, so there is a compatibility issue to address in
> changing that.  We have historically made some changes of this nature
> in the API, but it shouldn't be done without due consideration.
> 
> -zefram

Something still isn't thought out. How can an AV array length be 64 bits (64b IV with 32b ptrs) on a 32 bit OS? no AV array over 2/4GB (or really 4GB/4bytes indexes) can be alloced on a 32b OS, so an index over (2**32)/4 isn't needed for 64 bit IV with 32 bit pointer perl. I think the prototype should be dropped back to I32 * or size *.

-- 
bulk88 ~ bulk88 at hotmail.com

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



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