List Info

Thread: Re: Limitation of Array




Re: Limitation of Array
country flaguser name
Czech Republic
2008-03-06 03:41:54

From: merlyn%40stonehenge.com">merlynstonehenge.com
&gt; >>&gt;>> "Vijaya" == Vijaya Kumar < mp_vijayakumar%40yahoo.com">mp_vijayakumaryahoo.com> writes:
>
> Vijaya> How many elements can be stored in an array? I mean, is there any
> Vijaya> maximum limit for an array? If anybody knows, please answer.
>
> Perl imposes no limits, but it's certainly limited to whatever fits into the
> addressing space of a process on your system, because data is all
> memory-resident.

I kinda doubt it. The index of an array is an integer so I'd expect
the maximum limit to be your size of integers.

Which means
use Config;
$maxint = 2 ** ($Config{intsize}*8 - 1);

The limit looks way big enough so I doubt Perl bothers to check
whether it needs to promote to something bigger as the array grows.

Jenda
===== Jenda%40Krynicky.cz">JendaKrynicky.cz === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )