Skip to content

Instantly share code, notes, and snippets.

@vovkasm
Created July 5, 2013 11:23
Show Gist options
  • Save vovkasm/5933886 to your computer and use it in GitHub Desktop.
Save vovkasm/5933886 to your computer and use it in GitHub Desktop.
leaks: 5.16 no leaks: 5.14
#!perl
{
package Test;
sub new { bless pop||{}, shift; }
sub STORABLE_freeze {
my ($self) = @_;
delete $self->{a};
return $self;
}
sub STORABLE_attach {
my ($class) = @_;
return $class->new({ c => 3 });
}
}
use Storable qw/dclone/;
my $c = Test->new({ a => 1, b => 2 });
while(1) {
my $d = dclone($c);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment