Skip to content

Commit 98de8d9

Browse files
authored
Merge pull request #2012 from Kaiepi/nativecall
Document CArray.allocate
2 parents 59852f2 + d56e6b3 commit 98de8d9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

doc/Language/nativecall.pod6

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,8 @@ subroutine, otherwise the C function may stomp all over Perl's memory
287287
leading to possibly unpredictable behaviour:
288288
289289
=begin code :skip-test
290-
my $ints = CArray[int32].new;
291290
my $number_of_ints = 10;
292-
$ints[$number_of_ints - 1] = 0; # extend the array to 10 items
293-
291+
my $ints = CArray[int32].allocate($number_of_ints); # instantiates an array with 10 elements
294292
my $n = get_n_ints($ints, $number_of_ints);
295293
=end code
296294

0 commit comments

Comments
 (0)