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

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

Thread Previous | Thread Next
Tony Cook
July 28, 2013 03:08
Re: [perl #72784] [META] misuse of I32
Message ID:
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.


* stack, kernel space, mapped libraries, etc

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About