This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
(perl #127743) support for >= 4GB data from hooks
authorTony Cook <tony@develop-help.com>
Tue, 5 Dec 2017 04:24:20 +0000 (05:24 +0100)
committerTony Cook <tony@develop-help.com>
Thu, 8 Feb 2018 02:58:12 +0000 (13:58 +1100)
commit3d0888b3fde529a40f9319a657e0e2b5e881ee0d
treeea3404aa0452cac33154a712115771aa819e68ca
parent0079d24564f1f4a127cd1d78827adcab12ee3a33
(perl #127743) support for >= 4GB data from hooks

Though we use this mechanism for >= 2GB.

This emits an SX_LOBJECT op and writes the string length as a 64-bit
value if STORABLE_attach() returns more than 2GB of data.

The boundary is set at 2GB since older versions of Storable handle
sizes between 2GB and 4GB badly, resulting in a memory overwrite.  By
using the alternate op codes an older Storable will reject the data
instead.

We still accept such data that might have been written by an older
Storable.
dist/Storable/Storable.xs
dist/Storable/t/hugeids.t