develooper Front page | perl.perl5.porters | Postings from May 2002

Re: [PATCH] Storable (Re: perl@16433)

From:
Tim Bunce
Date:
May 7, 2002 13:13
Subject:
Re: [PATCH] Storable (Re: perl@16433)
Message ID:
20020507211328.V3003@dansat.data-plan.com
On Tue, May 07, 2002 at 05:08:08PM +0100, Nicholas Clark wrote:
> On Tue, May 07, 2002 at 04:28:24PM +0100, Tim Bunce wrote:
> > On Tue, May 07, 2002 at 03:00:00PM +0100, Nicholas Clark wrote:
> > > On Tue, May 07, 2002 at 04:53:42PM +0300, Jarkko Hietaniemi wrote:
> > > > On Tue, May 07, 2002 at 11:37:03AM +0300, Radu Greab wrote:
> > > 
> > > > > With the patch below all tests pass and the leaks are gone. Following
> > > > > the MY_CXT macros example all contexts use now a blessed SV and the
> > > > > root context is cleaned automatically.
> > > > 
> > > > Thanks, applied (and the STMT_XXX one, too).  Now I have to find
> > > > other things for Nicholas to do... :-)
> 
> > > I think the dog has a todo list for me. It goes roughly:
> 
> [snip "print "walk dog\n" while 1;]
> 
> > > Like other todo lists, the dog's todo list keeps getting longer.
> > 
> > Any chance you could get "put Storable onto CPAN" near the top?
> > Might have to walk dog / feed dog / play with dog first though...
> 
> The dog doesn't read p5p, so I think I can get away with it.

Ah, but you never know what dogs get up to when you're not looking.
Dogbert being a prime example. Beware!

> Somewhere back up the thread:
> 
> http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2002-05/msg00386.html

Ah, I missed that (too fast with the delete key when skimming my mailboxes).

+	} else if (type >= SX_ERROR && cxt->ver_minor > STORABLE_BIN_MINOR) {
+            if (cxt->accept_future_minor < 0)
+                cxt->accept_future_minor
+                    = (SvTRUE(perl_get_sv("Storable::accept_future_minor",
+                                          TRUE))
+                       ? 1 : 0);
+            if (cxt->accept_future_minor == 1) {
+                CROAK(("Storable binary image v%d.%d contains data of type %d. "
+                       "This Storable is v%d.%d and can only handle data types up to %d",
+                       cxt->ver_major, cxt->ver_minor, type,
+                       STORABLE_BIN_MAJOR, STORABLE_BIN_MINOR, SX_ERROR - 1));
+            }
+        }

I've not looked at the code in context, but if type >= SX_ERROR
then don't you *have* to croak? I think the accept_future_minor
test only applies at the point the cxt->ver_minor is set from the
header.

> I presented a patch for half of the finishing touches, and big thanks
> to Radu Greab for doing the other half (which I think was the bigger
> "half") so I'll try building Storable on all earlier perls tonight.

Wonderful, many thanks!

> What version number should it be released as?

I'd vote for 2.00 since it's a significant improvement in many ways
from the 1.01 that's 'out there'. It'll also align it with the
value of STORABLE_BIN_MAJOR (which hopefully now won't change for
a long time).

Tim.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About