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

Re: Inconsistencies in memory size types

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
June 17, 2016 14:29
Subject:
Re: Inconsistencies in memory size types
Message ID:
20160617141003.GE3840@iabyn.com
On Wed, Apr 06, 2016 at 09:26:24PM +0200, H.Merijn Brand wrote:
> On Wed, 06 Apr 2016 11:08:33 +0100, ilmari@ilmari.org (Dagfinn Ilmari
> Mannsåker) wrote:
> 
> > > I don't think there are issues anymore.  Unfortunately, XS code likely
> > > uses a mix of Size_t, MEM_SIZE, and STRLEN, so I'm not sure there's
> > > much you can actually do.  
> > 
> > This is why my patch makes Size_t, MEM_SIZE and STRLEN available #ifndef
> > PERL_CORE.  On second though, though, standardising on Size_t and
> > SSize_t will make things easier for upstream-blead dual-life modules
> > (unless they all use Devel::PPPort and we add the defines there).
> 
> Which is what I wanted to suggest. Make the core cleaner and have all
> backward compat available in Devel::PPPort should only cause a *little*
> extra effort on those XS modules that do not use it correct. It is
> unlikely to affect end users and cpan clients

My current preference is that core standardises on Size_t and SSize_t,
and eliminates usage of size_t, ssize_t, STRLEN and MEM_SIZE.


$ cat *.[ch] | grep -cw Size_t
103
$ cat *.[ch] | grep -cw size_t
130
$ cat *.[ch] | grep -cw SSize_t
472
$ cat *.[ch] | grep -cw ssize_t
7
$ cat *.[ch] | grep -cw STRLEN
1393
$ cat *.[ch] | grep -cw MEM_SIZE
80



-- 
"Do not dabble in paradox, Edward, it puts you in danger of fortuitous wit."
    -- Lady Croom, "Arcadia"

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