develooper Front page | perl.perl5.porters | Postings from July 2013

Re: [perl #72784] [META] misuse of I32

Thread Previous | Thread Next
From:
Tony Cook
Date:
July 28, 2013 03:08
Subject:
Re: [perl #72784] [META] misuse of I32
Message ID:
20130728030800.GA32322@mars.tony.develop-help.com
On Sat, Jul 27, 2013 at 07:33:28PM -0700, Father Chrysostomos via RT wrote:
> On Sat Feb 13 07:51:05 2010, nicholas wrote:
> > There's a lot of inappropriate use of the I32 type throughout the core.
> > Likely most should be something else, one of U32, STRLEN, SSize_t, IV
> or UV.
> > 
> > The misuse of I32 causes lots of bugs (panics, SEGVs, silent data
> errors) if
> > strings go over 2GB.
> > 
> > This is a meta-ticket for collating tickets relating to these sorts of
> bugs.
> > 
> 
> What should the maximum string and array lengths be?

I think it should be Ssize_t_max.

Or more C standardly - ptrdiff_t-max.

It might be possible in theory to support longer strings on a 32-bit
platform, but with all the bits and pieces that get allocated from the
address space* I don't think it's likely that there's an over 2G hole
to allocate such an object in.

Supporting larger objects on 32-bit platforms could complicate the
code for very little benefit.

Tony

* stack, kernel space, mapped libraries, etc

Thread Previous | Thread Next


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