Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Storable CPAN distribution.

Report information
The Basics
Id: 57976
Status: new
Priority: 0/
Queue: Storable

People
Owner: Nobody in particular
Requestors: nothingmuch [...] woobling.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: bug-Storable [...] rt.cpan.org, perl5-porters [...] perl.org
Subject: Re: Storable - Feature-request - alternate freeze/thaw hooks
Date: Sun, 30 May 2010 19:23:54 +0300
To: tabris <tabris [...] tabris.net>
From: Yuval Kogman <nothingmuch [...] woobling.org>
That would break circular references, which might not be a concern for GMP ints but is required for other things. However, ince the typemap specifies: OUTPUT MPZ sv_setref_pv($arg, \"Math::BigInt::GMP\", INT2PTR(void*, $var)); You can probably just get away with sub STORABLE_thaw { my ( $self ) = @_; my $new = ... thaw a new instance ...; bless $new, "Something::Else"; # avoid any destructors $$self = $$new; # simply steal the pointer } but it would probably be better to refactor the M::B::GMP code to allow doing this sort of thing without violating encapsulation.