just in case this helps. Looks like array size is stored in an 32 bit integer. Tested on 2 64 bit machines.

:[~]$ perl -e '$x[2**33]=109; print "$#x\n";'
0
:[~]$ perl -e '$x[2**31]=109; print "$#x\n";'
Modification of non-creatable array value attempted, subscript -2147483648 at -e line 1.
:[~]$ perl -e '$x[2**30]=109; print "$#x\n";'
1073741824
:[~]$ perl -V
Summary of my perl5 (revision 5 version 12 subversion 4) configuration:

  Platform:
    osname=linux, osvers=3.0.1-gentoo, archname=x86_64-linux-thread-multi
uname='linux riococo 3.0.1-gentoo #1 smp fri aug 12 18:27:13 cest 2011 x86_64 intel(r) xeon(r) cpu w3520 @ 2.67ghz genuineintel gnulinux ' config_args='-des -Duseshrplib -Darchname=x86_64-linux-thread -Dcc=x86_64-pc-linux-gnu-gcc -Doptimize=-O2 -pipe -march=core2 -fomit-frame-pointer -msse4 -msse4.1 -msse4.2 -mcx16 -msahf -Dldflags=-Wl,-O1 -Wl,--as-needed -Dprefix=/usr -Dsiteprefix=/usr -Dvendorprefix=/usr -Dscriptdir=/usr/bin -Dprivlib=/usr/lib64/perl5/5.12.4 -Darchlib=/usr/lib64/perl5/5.12.4/x86_64-linux-thread-multi -Dsitelib=/usr/lib64/perl5/site_perl/5.12.4 -Dsitearch=/usr/lib64/perl5/site_perl/5.12.4/x86_64-linux-thread-multi -Dvendorlib=/usr/lib64/perl5/vendor_perl/5.12.4 -Dvendorarch=/usr/lib64/perl5/vendor_perl/5.12.4/x86_64-linux-thread-multi -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/share/man/man1 -Dsiteman3dir=/usr/share/man/man3 -Dvendorman1dir=/usr/share/man/man1 -Dvendorman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -Dlibperl=libperl.so.5.12.4 -Dlocincpth= -Duselargefiles -Dd_semctl_semun -Dcf_by=Gentoo -Dmyhostname=localhost -Dperladmin=root@localhost -Dinstallusrbinperl=n -Ud_csh -Uusenm -Di_ndbm -Di_gdbm -Di_db -Dusethreads -DDEBUGGING=none -Dinc_version_list=5.12.3/x86_64-linux-thread-multi 5.12.3 5.12.2/x86_64-linux-thread-multi 5.12.2 5.12.1/x86_64-linux-thread-multi 5.12.1 5.12.0/x86_64-linux-thread-multi 5.12.0 -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
cc='x86_64-pc-linux-gnu-gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2 -pipe -march=core2 -fomit-frame-pointer -msse4 -msse4.1 -msse4.2 -mcx16 -msahf',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe'
    ccversion='', gccversion='4.5.3', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='x86_64-pc-linux-gnu-gcc', ldflags ='-Wl,-O1 -Wl,--as-needed'
    libpth=/usr/local/lib64 /lib64 /usr/lib64
libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.13.so, so=so, useshrplib=true, libperl=libperl.so.5.12.4
    gnulibc_version='2.13'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -pipe -march=core2 -fomit-frame-pointer -msse4 -msse4.1 -msse4.2 -mcx16 -msahf -Wl,-O1 -Wl,--as-needed'


Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_64_BIT_ALL
                        USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
                        USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API
  Locally applied patches:
    0001-gentoo_MakeMaker-RUNPATH.diff
    0002-gentoo_config_over.diff
    0003-gentoo_cpan_definstalldirs.diff
    0004-gentoo_cpanplus_definstalldirs.diff
    0005-gentoo_create-libperl-soname.diff
    0006-gentoo_MakeMaker-delete_packlist.diff
    0007-fixes_8d66b3f9_h2hp_fix.diff
    0008-fixes_f178b03b_h2ph_using_deprecated_goto.diff
    0009-gentoo_mod-paths.diff
    0010-gentoo_enc2xs.diff
    0011-gentoo_IO-Compress_AutoLoader_dropped_from_Compress-Zlib.diff
    0012-gentoo_drop-fstack-protector.diff
  Built under linux
  Compiled at Sep 22 2011 13:55:40
  @INC:
    /etc/perl
    /usr/lib64/perl5/site_perl/5.12.4/x86_64-linux-thread-multi
    /usr/lib64/perl5/site_perl/5.12.4
    /usr/lib64/perl5/vendor_perl/5.12.4/x86_64-linux-thread-multi
    /usr/lib64/perl5/vendor_perl/5.12.4
    /usr/lib64/perl5/site_perl/5.12.1/x86_64-linux-thread-multi
    /usr/lib64/perl5/site_perl/5.12.1
    /usr/lib64/perl5/site_perl
    /usr/lib64/perl5/vendor_perl/5.12.3/x86_64-linux-thread-multi
    /usr/lib64/perl5/vendor_perl/5.12.3
    /usr/lib64/perl5/vendor_perl/5.12.2/x86_64-linux-thread-multi
    /usr/lib64/perl5/vendor_perl/5.12.2
    /usr/lib64/perl5/vendor_perl/5.12.1/x86_64-linux-thread-multi
    /usr/lib64/perl5/vendor_perl/5.12.1
    /usr/lib64/perl5/vendor_perl
    /usr/lib64/perl5/5.12.4/x86_64-linux-thread-multi
    /usr/lib64/perl5/5.12.4
    /usr/local/lib/site_perl
    .





:[~]$ perl -V
Summary of my perl5 (revision 5 version 10 subversion 1) configuration:

  Platform:
osname=linux, osvers=2.6.24-28-server, archname=x86_64-linux-gnu-thread-multi uname='linux allspice 2.6.24-28-server #1 smp wed aug 18 21:17:51 utc 2010 x86_64 gnulinux ' config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=x86_64-linux-gnu -Dprefix=/usr -Dprivlib=/usr/share/perl/5.10 -Darchlib=/usr/lib/perl/5.10 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.10.1 -Dsitearch=/usr/local/lib/perl/5.10.1 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -Dlibperl=libperl.so.5.10.1 -Dd_dosuid -des'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -g',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.4.3', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64
    libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
    perllibs=-ldl -lm -lpthread -lc -lcrypt
libc=/lib/libc-2.11.1.so, so=so, useshrplib=true, libperl=libperl.so.5.10.1
    gnulibc_version='2.11.1'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib -fstack-protector'


Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_64_BIT_ALL
                        USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
                        USE_PERLIO USE_REENTRANT_API
  Built under linux
  Compiled at Apr 22 2011 18:54:26
  @INC:
    /etc/perl
    /usr/local/lib/perl/5.10.1
    /usr/local/share/perl/5.10.1
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.10
    /usr/share/perl/5.10
    /usr/local/lib/site_perl




On 02/24/2012 04:20 PM, Chris Marshall wrote:
It is I32 since this is the level where the perl level
is implemented in terms of C code and I32 is part
of the C level, not the API for accessing the perl
level *from* C.

I looked at the CORE/*.h and it seems that there
is no requirement that I32 or I16 have any specific
type/size so it should be possible to have a fully
64bit perl.  I would definitely like to know if that hypothesis
is true.  (This is coming from the issue of converting
our soon to be available 64bit piddles into perl lists
and what sort of checks we'll need to make to handle
this correctly and compatibly).

Thanks,
Chris

On Fri, Feb 24, 2012 at 10:08 AM, David Mertens
<[email protected]>  wrote:
<scratches head>

Yeah, I wonder why it's an I32 instead of an IV. Want me to ask the p5p
list?

David


On Fri, Feb 24, 2012 at 9:02 AM, Chris Marshall<[email protected]>
wrote:
I guess it could still be true/full 64bit if the I32
data type was actually a 64bit integer...

--Chris

On Fri, Feb 24, 2012 at 9:53 AM, Chris Marshall<[email protected]>
wrote:
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.  Maybe the feature is available in
a late model perl.

Thanks for the reply,
Chris



On Thu, Feb 23, 2012 at 8:55 PM, Sisyphus<[email protected]>
wrote:
----- Original Message ----- From: "Chris Marshall"


Is there such a thing as a "true 64bit perl" where
the number of elements in an array would be
indexed with, say, a 64bit int data type?

I've been told there exists compilers on some 64-bit systems where
sizeof(int) == 8.
One would expect that a perl built with such a compiler would index its
arrays with a 64-bit integer data type.

I don't have access to any "-Duse64bitall" builds of perl. I assumed
they
would index their arrays with a 64-bit integer data type, but am unable
to
check.

Note also that the *absence* of the use64bitxxx flags does not imply
32-bits. (You need to examine other flags, such as ivsize.) From the
INSTALL
file that ships with the perl source:

#################################
Natively 64-bit systems need neither -Duse64bitint nor -Duse64bitall.
On these systems, it might be the default compilation mode, and there
is currently no guarantee that passing no use64bitall option to the
Configure process will build a 32bit perl. Implementing -Duse32bit*
options is planned for a future release of perl.
#################################

Cheers,
Rob

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl



--
  "Debugging is twice as hard as writing the code in the first place.
   Therefore, if you write the code as cleverly as possible, you are,
   by definition, not smart enough to debug it." -- Brian Kernighan

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl



_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to