You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# FIXME: see http://pdl.perl.org/PDLdocs/API.html how to wrap $buf into a piddle
$$data = $buf;
$pdl->upd_data;
could be slightly shorter and also more efficient, using the same capability incorporated for PDL::Parallel::threads (see PDLPorters/PDL-Parallel-threads@fc7c3d8), to something like:
The new new_around_datasv constructor increases the refcount of the provided SV, so $buf going away at the end of the scope wouldn't be a problem. The advantage is that the data wouldn't need copying into the new ndarray's data area. Obviously, you'd need to bump your minimum-supported version of PDL to 2.091.
Please say if you'd like a PR executing this.
The text was updated successfully, but these errors were encountered:
my$pdl;
if ($PDL::VERSION >= 2.091) {
... # new code
}
else {
... # old code
}
This will lead to duplicate code but it does mean that users do not need to update PDL to keep using the latest Geo::GDAL::FFI. The Strawberry Perl 5.40 PDL version, for example, comes with PDL 2.089. SP 5.38 has PDL 2.085. FreeBSD is mostly on PDL 2.089 at the moment.
The versioned code can be cleaned up once PDL 2.091 or greater is in common use.
Hi, in PDL 2.091 (just released), this code:
Geo-GDAL-FFI/lib/Geo/GDAL/FFI/Band.pm
Lines 243 to 249 in 479f9ba
could be slightly shorter and also more efficient, using the same capability incorporated for PDL::Parallel::threads (see PDLPorters/PDL-Parallel-threads@fc7c3d8), to something like:
The new
new_around_datasv
constructor increases the refcount of the provided SV, so$buf
going away at the end of the scope wouldn't be a problem. The advantage is that the data wouldn't need copying into the new ndarray's data area. Obviously, you'd need to bump your minimum-supported version of PDL to 2.091.Please say if you'd like a PR executing this.
The text was updated successfully, but these errors were encountered: