diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-12-29 12:28:14 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-12-29 12:28:14 +0000 |
commit | 453d94a93e573c5979e959533fb269b76eb66968 (patch) | |
tree | f4ed259c9ac7d70b14de54d73ae0d0d241912aa1 /av.c | |
parent | a1cf41cd41cfa3d3c737acde06e0d3bbd02dd08d (diff) | |
download | perl-453d94a93e573c5979e959533fb269b76eb66968.tar.gz |
Change Perl_av_iter_p() to return IV* rather than I32* (which means
having to allocate memory where sizeof(IV) > sizeof(I32)).
p4raw-id: //depot/perl@32760
Diffstat (limited to 'av.c')
-rw-r--r-- | av.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -970,11 +970,18 @@ Perl_av_arylen_p(pTHX_ AV *av) { return &(mg->mg_obj); } -/* This will change to returning IV ** at some point soon */ -I32 * +IV * Perl_av_iter_p(pTHX_ AV *av) { MAGIC *const mg = get_aux_mg(av); +#if IVSIZE == I32SIZE return &(mg->mg_len); +#else + if (!mg->mg_ptr) { + mg->mg_len = IVSIZE; + Newxz(mg->mg_ptr, 1, IV); + } + return (IV *)mg->mg_ptr; +#endif } /* |