[Perldl] question about use64bitall perl
Ingo Schmid
ingosch at gmx.at
Sun Feb 26 23:44:46 HST 2012
in /usr/lib64/perl5/5.12.4/x86_64-linux-thread-multi/CORE/config.h:
#define I32TYPE int /**/
On 02/24/2012 10:42 PM, Sisyphus wrote:
>
> ----- Original Message ----- From: "Chris Marshall"
> <devel.chm.01 at gmail.com>
> To: "Sisyphus" <sisyphus1 at optusnet.com.au>
> Cc: "Perldl at jach.hawaii.edu" <perldl at jach.hawaii.edu>
> Sent: Saturday, February 25, 2012 1:53 AM
> Subject: Re: [Perldl] question about use64bitall perl
>
>
>> The specific question is about the internal perl
>> array index type as exposed by the perlapi. E.g.,
>>
>> SV* av_delete(AV *av, I32 key, I32 flags)
>> bool av_exists(AV *av, I32 key)
>> void av_extend(AV *av, I32 key)
>> SV** av_fetch(AV *av, I32 key, I32 lval)
>> void av_fill(AV *av, I32 fill)
>> I32 av_len(const AV *av)
>> ....
>>
>> where you can see the I32 type everywhere. I
>> found no instance where it is not I32 in my
>> perldoc searches nor in my various google
>> attempts.
>
> Which then raises the question "What is sizeof(I32) ?".
>
> I see this in my config.h:
>
> /* I32SIZE:
> * This symbol contains the sizeof(I32).
> */
>
> which suggests that it might not be guaranteed to be 32 bits.
>
> Simplest way to find out (as suggested by David) is to ask p5p "Under
> what (if any) circumstances will the sizeof(I32) be other than 4 ?".
>
> The answer could also be found in the perl sources, if one knew where
> to look. It would be a matter of working through the procedure that
> determines what I32TYPE (which is later typedef'd to I32) is set to.
>
> Looking at Ingo's 'perl -V' it seems that *some* trouble is taken to
> find a 32-bit type - I deduce that 'long' is rejected as it's 64 bits,
> so 'int' is presumably selected. Ingo, does your CORE/config.h report
> that I32TYPE is int ?
> If 'int' had also been 64-bits, would 'short' then have been considered ?
> And if none of 'short', 'int', 'long' are 32-bits, what happens then ?
>
> Interesting stuff :-)
>
> Cheers,
> Rob
>
>
>
>
>
> _______________________________________________
> Perldl mailing list
> Perldl at jach.hawaii.edu
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>
More information about the Perldl
mailing list