mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 03:43:52 +00:00
Massive reduction of memory usage (down to one third).
This commit is contained in:
@@ -21,6 +21,22 @@ sub new {
|
||||
$self;
|
||||
}
|
||||
|
||||
sub serialize {
|
||||
my $self = shift;
|
||||
my $s = \ pack 'l*', map @$_, @$self;
|
||||
bless $s, ref $self;
|
||||
return $s;
|
||||
}
|
||||
|
||||
sub deserialize {
|
||||
my $self = shift;
|
||||
my @v = unpack '(l2)*', $$self;
|
||||
my $o = [ map [ $v[2*$_], $v[2*$_+1] ], 0 .. int($#v/2) ];
|
||||
bless $_, 'Slic3r::Point' for @$o;
|
||||
bless $o, ref $self;
|
||||
return $o;
|
||||
}
|
||||
|
||||
sub id {
|
||||
my $self = shift;
|
||||
return join ' - ', sort map $_->id, @$self;
|
||||
|
||||
Reference in New Issue
Block a user