From 2d8e9e45f9a5524353cb4deaacf8295644809c94 Mon Sep 17 00:00:00 2001 From: gregor herrmann Date: Thu, 11 Jun 2020 18:09:12 +0200 Subject: [PATCH] New upstream version 4.012+ds --- Changes | 4 ++++ META.json | 6 +++--- META.yml | 4 ++-- lib/Sereal/Encoder.pm | 33 ++++++++++++++++++++++----------- lib/Sereal/Encoder/Constants.pm | 2 +- 5 files changed, 32 insertions(+), 17 deletions(-) diff --git a/Changes b/Changes index fbb7e61..fc45fb5 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,10 @@ Revision history for Perl extension Sereal-Encoder * of the decoder before upgrading to version 4 of the * * encoder! * **************************************************************** +4.012 Weds June 10, 2020 + * Fix memory leak, thanks to Kirill Sysoev + * Fix memory leak in looks_like_sereal(), thanks to Kirill Sysoev + 4.011 Tues February 4, 2020 * Fix and test custom opcode logic for 5.31.2 and later. diff --git a/META.json b/META.json index 4d19be8..e8ca803 100644 --- a/META.json +++ b/META.json @@ -4,7 +4,7 @@ "Steffen Mueller , Yves Orton " ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 2.150010", + "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], @@ -62,6 +62,6 @@ "url" : "git://github.com/Sereal/Sereal.git" } }, - "version" : "4.011", - "x_serialization_backend" : "JSON::PP version 4.04" + "version" : "4.012", + "x_serialization_backend" : "JSON::PP version 4.02" } diff --git a/META.yml b/META.yml index aa3b2d7..5bd409e 100644 --- a/META.yml +++ b/META.yml @@ -18,7 +18,7 @@ build_requires: configure_requires: ExtUtils::MakeMaker: '7.0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 2.150010' +generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -34,5 +34,5 @@ requires: resources: bugtracker: https://github.com/Sereal/Sereal/issues repository: git://github.com/Sereal/Sereal.git -version: '4.011' +version: '4.012' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff --git a/lib/Sereal/Encoder.pm b/lib/Sereal/Encoder.pm index 6e51541..e6b08e0 100644 --- a/lib/Sereal/Encoder.pm +++ b/lib/Sereal/Encoder.pm @@ -5,7 +5,7 @@ use warnings; use Carp qw/croak/; use XSLoader; -our $VERSION= '4.011'; # Don't forget to update the TestCompat set for testing against installed decoders! +our $VERSION= '4.012'; # Don't forget to update the TestCompat set for testing against installed decoders! our $XS_VERSION= $VERSION; $VERSION= eval $VERSION; # not for public consumption, just for testing. @@ -16,14 +16,17 @@ sub _test_compat { return ( @$TestCompat, $VERSION ) } # Make sure to keep these constants in sync with the C code in srl_encoder.c. # I know they could be exported from C using things like ExtUtils::Constant, # but that's too much of a hassle for just three numbers. -use constant { +#start-no-tidy +my ($compress_consts, $full_consts); +BEGIN { +$compress_consts= { SRL_UNCOMPRESSED => 0, SRL_SNAPPY => 1, SRL_ZLIB => 2, SRL_ZSTD => 3, }; -#start-no-tidy -use constant #begin generated +$full_consts= +#begin generated { 'SRL_F_ALIASED_DEDUPE_STRINGS' => 4096, 'SRL_F_CANONICAL_REFS' => 32768, @@ -70,20 +73,28 @@ use constant #begin generated 'SORT_KEYS_PERL_REV', 'COMPRESS_ZSTD' ] -}; #end generated +}; +#end generated +} +use constant $compress_consts; +use constant $full_consts; #end-no-tidy use Exporter 'import'; -our @EXPORT_OK= qw( +our @EXPORT_OK= (qw( encode_sereal encode_sereal_with_header_data sereal_encode_with_object - SRL_UNCOMPRESSED - SRL_SNAPPY - SRL_ZLIB - SRL_ZSTD +), sort { $a cmp $b } +( + keys(%$compress_consts), + keys(%$full_consts) +)); +our %EXPORT_TAGS= ( + all => \@EXPORT_OK, + compress_const => [ sort keys %$compress_consts ], + full_const => [ sort(keys(%$compress_consts),keys(%$full_consts)) ], ); -our %EXPORT_TAGS= ( all => \@EXPORT_OK ); # export by default if run from command line our @EXPORT= ( ( caller() )[1] eq '-e' ? @EXPORT_OK : () ); diff --git a/lib/Sereal/Encoder/Constants.pm b/lib/Sereal/Encoder/Constants.pm index 58cf8bc..642ec86 100644 --- a/lib/Sereal/Encoder/Constants.pm +++ b/lib/Sereal/Encoder/Constants.pm @@ -4,7 +4,7 @@ use warnings; require Exporter; our @ISA= qw(Exporter); -our $VERSION= '4.011'; # Don't forget to update the TestCompat set for testing against installed encoders! +our $VERSION= '4.012'; # Don't forget to update the TestCompat set for testing against installed encoders! our ( @EXPORT_OK, %DEFINE, %TAG_INFO_HASH, @TAG_INFO_ARRAY ); -- 2.30.2