diff -Nru libobject-pad-perl-0.64/Changes libobject-pad-perl-0.65/Changes --- libobject-pad-perl-0.64/Changes 2022-04-02 16:41:07.000000000 +0000 +++ libobject-pad-perl-0.65/Changes 2022-05-10 21:04:22.000000000 +0000 @@ -1,5 +1,13 @@ Revision history for Object-Pad +0.65 2022-05-10 + [CHANGES] + * Document the required version for :experimental tags + * Mention the new Devel::MAT::Tool::Object::Pad in docs + + [BUGFIXES] + * Update cv_copy_flags() for SvPADTMP fix; related to RT142468 + 0.64 2022-04-02 [CHANGES] * Improvements to `:experimental` import tag (RT141801): diff -Nru libobject-pad-perl-0.64/debian/changelog libobject-pad-perl-0.65/debian/changelog --- libobject-pad-perl-0.64/debian/changelog 2022-04-05 16:18:36.000000000 +0000 +++ libobject-pad-perl-0.65/debian/changelog 2022-05-12 08:15:58.000000000 +0000 @@ -1,3 +1,10 @@ +libobject-pad-perl (0.65-1) unstable; urgency=medium + + [ upstream ] + * new release + + -- Jonas Smedegaard Thu, 12 May 2022 10:15:58 +0200 + libobject-pad-perl (0.64-1) unstable; urgency=medium * Import upstream version 0.64. diff -Nru libobject-pad-perl-0.64/hax/cv_copy_flags.c.inc libobject-pad-perl-0.65/hax/cv_copy_flags.c.inc --- libobject-pad-perl-0.64/hax/cv_copy_flags.c.inc 2022-04-02 16:41:07.000000000 +0000 +++ libobject-pad-perl-0.65/hax/cv_copy_flags.c.inc 2022-05-10 21:04:22.000000000 +0000 @@ -123,7 +123,11 @@ else if(!origpad[padix]) newval = NULL; else if(SvPADTMP(origpad[padix])) { - newval = newSV(0); + /* We still have to copy the value, in case it is live. Also core perl + * is known to set SvPADTMP on non-temporaries, like folded constants + * https://rt.cpan.org/Ticket/Display.html?id=142468 + */ + newval = newSVsv(origpad[padix]); SvPADTMP_on(newval); } else { diff -Nru libobject-pad-perl-0.64/lib/Object/Pad/ExtensionBuilder_data.pm.PL libobject-pad-perl-0.65/lib/Object/Pad/ExtensionBuilder_data.pm.PL --- libobject-pad-perl-0.64/lib/Object/Pad/ExtensionBuilder_data.pm.PL 2022-04-02 16:41:07.000000000 +0000 +++ libobject-pad-perl-0.65/lib/Object/Pad/ExtensionBuilder_data.pm.PL 2022-05-10 21:04:22.000000000 +0000 @@ -19,7 +19,7 @@ <$in_h> } ); __DATA__ -package Object::Pad::ExtensionBuilder_data 0.64; +package Object::Pad::ExtensionBuilder_data 0.65; use v5.14; use warnings; diff -Nru libobject-pad-perl-0.64/lib/Object/Pad/ExtensionBuilder.pm libobject-pad-perl-0.65/lib/Object/Pad/ExtensionBuilder.pm --- libobject-pad-perl-0.64/lib/Object/Pad/ExtensionBuilder.pm 2022-04-02 16:41:07.000000000 +0000 +++ libobject-pad-perl-0.65/lib/Object/Pad/ExtensionBuilder.pm 2022-05-10 21:04:22.000000000 +0000 @@ -3,7 +3,7 @@ # # (C) Paul Evans, 2021 -- leonerd@leonerd.org.uk -package Object::Pad::ExtensionBuilder 0.64; +package Object::Pad::ExtensionBuilder 0.65; use v5.14; use warnings; diff -Nru libobject-pad-perl-0.64/lib/Object/Pad/MOP/Class.pm libobject-pad-perl-0.65/lib/Object/Pad/MOP/Class.pm --- libobject-pad-perl-0.64/lib/Object/Pad/MOP/Class.pm 2022-04-02 16:41:07.000000000 +0000 +++ libobject-pad-perl-0.65/lib/Object/Pad/MOP/Class.pm 2022-05-10 21:04:22.000000000 +0000 @@ -3,7 +3,7 @@ # # (C) Paul Evans, 2020-2022 -- leonerd@leonerd.org.uk -package Object::Pad::MOP::Class 0.64; +package Object::Pad::MOP::Class 0.65; use v5.14; use warnings; diff -Nru libobject-pad-perl-0.64/lib/Object/Pad/MOP/FieldAttr.pm libobject-pad-perl-0.65/lib/Object/Pad/MOP/FieldAttr.pm --- libobject-pad-perl-0.64/lib/Object/Pad/MOP/FieldAttr.pm 2022-04-02 16:41:07.000000000 +0000 +++ libobject-pad-perl-0.65/lib/Object/Pad/MOP/FieldAttr.pm 2022-05-10 21:04:22.000000000 +0000 @@ -3,7 +3,7 @@ # # (C) Paul Evans, 2021-2022 -- leonerd@leonerd.org.uk -package Object::Pad::MOP::FieldAttr 0.64; +package Object::Pad::MOP::FieldAttr 0.65; use v5.14; use warnings; diff -Nru libobject-pad-perl-0.64/lib/Object/Pad/MOP/Field.pm libobject-pad-perl-0.65/lib/Object/Pad/MOP/Field.pm --- libobject-pad-perl-0.64/lib/Object/Pad/MOP/Field.pm 2022-04-02 16:41:07.000000000 +0000 +++ libobject-pad-perl-0.65/lib/Object/Pad/MOP/Field.pm 2022-05-10 21:04:22.000000000 +0000 @@ -3,7 +3,7 @@ # # (C) Paul Evans, 2020-2022 -- leonerd@leonerd.org.uk -package Object::Pad::MOP::Field 0.64; +package Object::Pad::MOP::Field 0.65; use v5.14; use warnings; diff -Nru libobject-pad-perl-0.64/lib/Object/Pad/MOP/Method.pm libobject-pad-perl-0.65/lib/Object/Pad/MOP/Method.pm --- libobject-pad-perl-0.64/lib/Object/Pad/MOP/Method.pm 2022-04-02 16:41:07.000000000 +0000 +++ libobject-pad-perl-0.65/lib/Object/Pad/MOP/Method.pm 2022-05-10 21:04:22.000000000 +0000 @@ -3,7 +3,7 @@ # # (C) Paul Evans, 2020 -- leonerd@leonerd.org.uk -package Object::Pad::MOP::Method 0.64; +package Object::Pad::MOP::Method 0.65; use v5.14; use warnings; diff -Nru libobject-pad-perl-0.64/lib/Object/Pad.pm libobject-pad-perl-0.65/lib/Object/Pad.pm --- libobject-pad-perl-0.64/lib/Object/Pad.pm 2022-04-02 16:41:07.000000000 +0000 +++ libobject-pad-perl-0.65/lib/Object/Pad.pm 2022-05-10 21:04:22.000000000 +0000 @@ -3,7 +3,7 @@ # # (C) Paul Evans, 2019-2022 -- leonerd@leonerd.org.uk -package Object::Pad 0.64; +package Object::Pad 0.65; use v5.14; use warnings; @@ -28,6 +28,8 @@ require Object::Pad::MOP::Class; +=encoding UTF-8 + =head1 NAME C - a simple syntax for lexical field-based objects @@ -95,6 +97,8 @@ =head2 Experimental Features +I + Some of the features of this module are currently marked as experimental. They will provoke warnings in the C category, unless silenced. @@ -111,6 +115,8 @@ use Object::Pad ':experimental'; # all of the above +I + Multiple experimental features can be enabled at once by giving multiple names in the parens, separated by spaces: @@ -1099,6 +1105,25 @@ ensure that object instance fields can be C set during a suspended C. +=head2 Devel::MAT + +When using L to help analyse or debug memory issues with programs +that use C, you will likely want to additionally install the +module L. This will provide new commands and +extend existing ones to better assist with analysing details related to +C classes and instances of them. + + pmat> fields 0x55d7c173d4b8 + The field AV ARRAY(3)=NativeClass at 0x55d7c173d4b8 + Ix Field Value + 0 $sfield SCALAR(UV) at 0x55d7c173d938 = 123 + ... + + pmat> identify 0x55d7c17606d8 + REF() at 0x55d7c17606d8 is: + └─the %hfield field of ARRAY(3)=NativeClass at 0x55d7c173d4b8, which is: + ... + =head1 DESIGN TODOs The following points are details about the design of pad field-based object diff -Nru libobject-pad-perl-0.64/META.json libobject-pad-perl-0.65/META.json --- libobject-pad-perl-0.64/META.json 2022-04-02 16:41:07.000000000 +0000 +++ libobject-pad-perl-0.65/META.json 2022-05-10 21:04:22.000000000 +0000 @@ -44,27 +44,27 @@ "provides" : { "Object::Pad" : { "file" : "lib/Object/Pad.pm", - "version" : "0.64" + "version" : "0.65" }, "Object::Pad::ExtensionBuilder" : { "file" : "lib/Object/Pad/ExtensionBuilder.pm", - "version" : "0.64" + "version" : "0.65" }, "Object::Pad::MOP::Class" : { "file" : "lib/Object/Pad/MOP/Class.pm", - "version" : "0.64" + "version" : "0.65" }, "Object::Pad::MOP::Field" : { "file" : "lib/Object/Pad/MOP/Field.pm", - "version" : "0.64" + "version" : "0.65" }, "Object::Pad::MOP::FieldAttr" : { "file" : "lib/Object/Pad/MOP/FieldAttr.pm", - "version" : "0.64" + "version" : "0.65" }, "Object::Pad::MOP::Method" : { "file" : "lib/Object/Pad/MOP/Method.pm", - "version" : "0.64" + "version" : "0.65" } }, "release_status" : "stable", @@ -73,6 +73,6 @@ "http://dev.perl.org/licenses/" ] }, - "version" : "0.64", + "version" : "0.65", "x_serialization_backend" : "JSON::PP version 4.06" } diff -Nru libobject-pad-perl-0.64/META.yml libobject-pad-perl-0.65/META.yml --- libobject-pad-perl-0.64/META.yml 2022-04-02 16:41:07.000000000 +0000 +++ libobject-pad-perl-0.65/META.yml 2022-05-10 21:04:22.000000000 +0000 @@ -21,27 +21,27 @@ provides: Object::Pad: file: lib/Object/Pad.pm - version: '0.64' + version: '0.65' Object::Pad::ExtensionBuilder: file: lib/Object/Pad/ExtensionBuilder.pm - version: '0.64' + version: '0.65' Object::Pad::MOP::Class: file: lib/Object/Pad/MOP/Class.pm - version: '0.64' + version: '0.65' Object::Pad::MOP::Field: file: lib/Object/Pad/MOP/Field.pm - version: '0.64' + version: '0.65' Object::Pad::MOP::FieldAttr: file: lib/Object/Pad/MOP/FieldAttr.pm - version: '0.64' + version: '0.65' Object::Pad::MOP::Method: file: lib/Object/Pad/MOP/Method.pm - version: '0.64' + version: '0.65' requires: XS::Parse::Keyword: '0.22' XS::Parse::Sublike: '0.15' perl: '5.018' resources: license: http://dev.perl.org/licenses/ -version: '0.64' +version: '0.65' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -Nru libobject-pad-perl-0.64/README libobject-pad-perl-0.65/README --- libobject-pad-perl-0.64/README 2022-04-02 16:41:07.000000000 +0000 +++ libobject-pad-perl-0.65/README 2022-05-10 21:04:22.000000000 +0000 @@ -67,6 +67,8 @@ Experimental Features + Since version 0.63. + Some of the features of this module are currently marked as experimental. They will provoke warnings in the experimental category, unless silenced. @@ -85,6 +87,8 @@ use Object::Pad ':experimental'; # all of the above + Since version 0.64. + Multiple experimental features can be enabled at once by giving multiple names in the parens, separated by spaces: @@ -1014,6 +1018,25 @@ to ensure that object instance fields can be dynamically set during a suspended async method. + Devel::MAT + + When using Devel::MAT to help analyse or debug memory issues with + programs that use Object::Pad, you will likely want to additionally + install the module Devel::MAT::Tool::Object::Pad. This will provide new + commands and extend existing ones to better assist with analysing + details related to Object::Pad classes and instances of them. + + pmat> fields 0x55d7c173d4b8 + The field AV ARRAY(3)=NativeClass at 0x55d7c173d4b8 + Ix Field Value + 0 $sfield SCALAR(UV) at 0x55d7c173d938 = 123 + ... + + pmat> identify 0x55d7c17606d8 + REF() at 0x55d7c17606d8 is: + └─the %hfield field of ARRAY(3)=NativeClass at 0x55d7c173d4b8, which is: + ... + DESIGN TODOs The following points are details about the design of pad field-based diff -Nru libobject-pad-perl-0.64/t/40role.t libobject-pad-perl-0.65/t/40role.t --- libobject-pad-perl-0.64/t/40role.t 2022-04-02 16:41:07.000000000 +0000 +++ libobject-pad-perl-0.65/t/40role.t 2022-05-10 21:04:22.000000000 +0000 @@ -104,4 +104,17 @@ is( FClass->onetwothree, 123, 'FClass has a :common ->onetwothree method' ); } +# Perl #19676 +# https://github.com/Perl/perl5/issues/19676 + +role GRole { + method a { pack "C", 65 } +} + +class GClass :does(GRole) {} + +{ + is( GClass->new->a, "A", 'GClass ->a method has constant' ); +} + done_testing;