diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-08-25 00:08:21 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-08-25 06:40:34 -0700 |
commit | c70927a6ffc3cac8e5ec375a3f7e13b4f7bd1ee4 (patch) | |
tree | 477e6abc58c0898bee5727b3feb27c9af685f49b /pod/perlguts.pod | |
parent | 9a543cee73966ca61d6dc71cc7322f271f5b6b8b (diff) | |
download | perl-c70927a6ffc3cac8e5ec375a3f7e13b4f7bd1ee4.tar.gz |
Use SSize_t for arrays
Make the array interface 64-bit safe by using SSize_t instead of I32
for array indices.
This is based on a patch by Chip Salzenberg.
This completes what the previous commit began when it changed
av_extend.
Diffstat (limited to 'pod/perlguts.pod')
-rw-r--r-- | pod/perlguts.pod | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pod/perlguts.pod b/pod/perlguts.pod index 29a30bf2ee..ac9224cb70 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -332,7 +332,7 @@ empty AV: The second method both creates the AV and initially populates it with SVs: - AV* av_make(I32 num, SV **ptr); + AV* av_make(SSize_t num, SV **ptr); The second argument points to an array containing C<num> C<SV*>'s. Once the AV has been created, the SVs can be destroyed, if so desired. @@ -342,7 +342,7 @@ Once the AV has been created, the following operations are possible on it: void av_push(AV*, SV*); SV* av_pop(AV*); SV* av_shift(AV*); - void av_unshift(AV*, I32 num); + void av_unshift(AV*, SSize_t num); These should be familiar operations, with the exception of C<av_unshift>. This routine adds C<num> elements at the front of the array with the C<undef> @@ -351,9 +351,9 @@ to these new elements. Here are some other functions: - I32 av_top_index(AV*); - SV** av_fetch(AV*, I32 key, I32 lval); - SV** av_store(AV*, I32 key, SV* val); + SSize_t av_top_index(AV*); + SV** av_fetch(AV*, SSize_t key, I32 lval); + SV** av_store(AV*, SSize_t key, SV* val); The C<av_top_index> function returns the highest index value in an array (just like $#array in Perl). If the array is empty, -1 is returned. The @@ -370,7 +370,7 @@ A few more: void av_clear(AV*); void av_undef(AV*); - void av_extend(AV*, I32 key); + void av_extend(AV*, SSize_t key); The C<av_clear> function deletes all the elements in the AV* array, but does not actually delete the array itself. The C<av_undef> function will |