On 2/27/2012 4:44 AM, Ingo Schmid wrote:

in /usr/lib64/perl5/5.12.4/x86_64-linux-thread-multi/CORE/config.h:



#define I32TYPE int /**/

Yes, all signs appear to point to there not being
a "true" 64bit perl with >2**32 elements possible
in an array/hash.  At the least, it seems that any
64bit support for pdl data should assume that there
are not 64bit arrays in perl and not try to convert
via ->list in that case (not that such a conversion
would be useful computationally).

--Chris


On 02/24/2012 10:42 PM, Sisyphus wrote:

----- Original Message ----- From: "Chris Marshall"
<[email protected]>
To: "Sisyphus" <[email protected]>
Cc: "[email protected]" <[email protected]>
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
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to