r61638 - in /branches/upstream/libclass-xsaccessor-perl/current: Changes MANIFEST META.yml XSAccessor.xs lib/Class/XSAccessor.pm lib/Class/XSAccessor/Array.pm lib/Class/XSAccessor/Heavy.pm t/40hash_bad_call.t t/41array_bad_call.t
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Mon Aug 16 04:36:17 UTC 2010
Author: ansgar-guest
Date: Mon Aug 16 04:35:57 2010
New Revision: 61638
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=61638
Log:
[svn-upgrade] new version libclass-xsaccessor-perl (1.07)
Added:
branches/upstream/libclass-xsaccessor-perl/current/t/40hash_bad_call.t
branches/upstream/libclass-xsaccessor-perl/current/t/41array_bad_call.t
Modified:
branches/upstream/libclass-xsaccessor-perl/current/Changes
branches/upstream/libclass-xsaccessor-perl/current/MANIFEST
branches/upstream/libclass-xsaccessor-perl/current/META.yml
branches/upstream/libclass-xsaccessor-perl/current/XSAccessor.xs
branches/upstream/libclass-xsaccessor-perl/current/lib/Class/XSAccessor.pm
branches/upstream/libclass-xsaccessor-perl/current/lib/Class/XSAccessor/Array.pm
branches/upstream/libclass-xsaccessor-perl/current/lib/Class/XSAccessor/Heavy.pm
Modified: branches/upstream/libclass-xsaccessor-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-xsaccessor-perl/current/Changes?rev=61638&op=diff
==============================================================================
--- branches/upstream/libclass-xsaccessor-perl/current/Changes (original)
+++ branches/upstream/libclass-xsaccessor-perl/current/Changes Mon Aug 16 04:35:57 2010
@@ -1,10 +1,16 @@
Revision history for Perl extension Class-XSAccessor.
+1.07 Sun Aug 15 14:41 2010
+ - Include two new test files for the fix in 1.06.
+ - Define PERL_CORE, but *only* while including XSUB.h to get
+ a significant speed-up (see XSAccessor.xs for an explanation).
+ Idea from Chocolateboy. Complaints from rightfully annoyed
+ perl5-porters (in particular but not limited to Nicholas)
+ go to Steffen.
+
1.06 Sat Aug 14 20:21 2010
- - Add sanity checks in the optimized (5.10 and up)
- implementations to make sure we don't segfault on
- $not_a_hashref->accessor
- (Chocolateboy
+ - Add sanity checks to make sure we don't segfault on
+ invalid invocants (chocolateboy)
1.05 Sun Nov 15 12:54 2009
- Minor developer doc tweaks.
@@ -26,7 +32,7 @@
** This release features some very radical changes. Test well. **
- Replace use of perl hashes in the global hash key name storage with
a full-blown, separate implementation of a hash table
- (Steffen, Chocolateboy)
+ (Steffen, chocolateboy)
- Similarly, throw out the SV's for simple C strings.
- Add a global lock for all modifications to global data structures:
- The above three items fix RT #50454 (serious threading issues).
@@ -36,19 +42,19 @@
1.04_02 Mon Sep 7 11:35 2009
** This release features some very radical changes. Test well. **
- Significant optimization by replacing the relevant entersub ops
- with stripped down versions (Chocolateboy)
+ with stripped down versions (chocolateboy)
1.04_01 Mon Sep 7 11:35 2009
** This release features some very radical changes. Test well. **
- - More aggressive OPTIMIZE flags if possible (Chocolateboy)
+ - More aggressive OPTIMIZE flags if possible (chocolateboy)
- Added shorthand syntax for getters, setters, accessors, and predicates
- where the attribute has the same name as the method (Chocolateboy)
+ where the attribute has the same name as the method (chocolateboy)
- Remove dependency on AutoXS::Header.
- Merge Class::XSAccessor::Array into this distribution.
- Refactored the XS to remove duplicate code.
- Refactored the perl code in XSAccessor.pm and Array.pm to remove
duplicate code (=> Heavy.pm).
- - Upgrade Devel::PPPort/ppport.h (Chocolateboy)
+ - Upgrade Devel::PPPort/ppport.h (chocolateboy)
1.04 Thu Jun 11 16:40 2009
- Fix a bunch of warnings thanks to a heads up from
@@ -100,8 +106,8 @@
- Copy input scalars on setter/mutator calls (RT #38573)
0.05 Sat Jun 21 18:06 2008
- - Add read/write accessors. (Chocolateboy)
- - By default, return the new value from setters. (Chocolateboy)
+ - Add read/write accessors. (chocolateboy)
+ - By default, return the new value from setters. (chocolateboy)
- Add predicates, i.e. "has_foo".
0.04 Mon May 3 19:12 2008
Modified: branches/upstream/libclass-xsaccessor-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-xsaccessor-perl/current/MANIFEST?rev=61638&op=diff
==============================================================================
--- branches/upstream/libclass-xsaccessor-perl/current/MANIFEST (original)
+++ branches/upstream/libclass-xsaccessor-perl/current/MANIFEST Mon Aug 16 04:35:57 2010
@@ -27,6 +27,8 @@
t/36array_constructor.t
t/37array_boolean.t
t/38array_use_hash.t
+t/40hash_bad_call.t
+t/41array_bad_call.t
XS/Array.xs
XS/Hash.xs
XSAccessor.xs
Modified: branches/upstream/libclass-xsaccessor-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-xsaccessor-perl/current/META.yml?rev=61638&op=diff
==============================================================================
--- branches/upstream/libclass-xsaccessor-perl/current/META.yml (original)
+++ branches/upstream/libclass-xsaccessor-perl/current/META.yml Mon Aug 16 04:35:57 2010
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Class-XSAccessor
-version: 1.06
+version: 1.07
abstract: Generate fast XS accessors without runtime compilation
author:
- Steffen Mueller <smueller at cpan.org>
Modified: branches/upstream/libclass-xsaccessor-perl/current/XSAccessor.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-xsaccessor-perl/current/XSAccessor.xs?rev=61638&op=diff
==============================================================================
--- branches/upstream/libclass-xsaccessor-perl/current/XSAccessor.xs (original)
+++ branches/upstream/libclass-xsaccessor-perl/current/XSAccessor.xs Mon Aug 16 04:35:57 2010
@@ -1,7 +1,33 @@
#define PERL_NO_GET_CONTEXT
#include "EXTERN.h"
#include "perl.h"
+
+/*
+ * Quoting chocolateboy from his Method::Lexical module at 2009-02-08:
+ *
+ * for binary compatibility (see perlapi.h), XS modules perform a function call to
+ * access each and every interpreter variable. So, for instance, an innocuous-looking
+ * reference to PL_op becomes:
+ *
+ * (*Perl_Iop_ptr(my_perl))
+ *
+ * This (obviously) impacts performance. Internally, PL_op is accessed as:
+ *
+ * my_perl->Iop
+ *
+ * (in threaded/multiplicity builds (see intrpvar.h)), which is significantly faster.
+ *
+ * defining PERL_CORE gets us the fast version, at the expense of a future maintenance release
+ * possibly breaking things: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00171.html
+ *
+ * Rather than globally defining PERL_CORE, which pokes its fingers into various headers, exposing
+ * internals we'd rather not see, just define it for XSUB.h, which includes
+ * perlapi.h, which imposes the speed limit.
+ */
+
+#define PERL_CORE
#include "XSUB.h"
+#undef PERL_CORE
#include "ppport.h"
Modified: branches/upstream/libclass-xsaccessor-perl/current/lib/Class/XSAccessor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-xsaccessor-perl/current/lib/Class/XSAccessor.pm?rev=61638&op=diff
==============================================================================
--- branches/upstream/libclass-xsaccessor-perl/current/lib/Class/XSAccessor.pm (original)
+++ branches/upstream/libclass-xsaccessor-perl/current/lib/Class/XSAccessor.pm Mon Aug 16 04:35:57 2010
@@ -7,7 +7,7 @@
use Carp qw/croak/;
-our $VERSION = '1.06';
+our $VERSION = '1.07';
require XSLoader;
XSLoader::load('Class::XSAccessor', $VERSION);
Modified: branches/upstream/libclass-xsaccessor-perl/current/lib/Class/XSAccessor/Array.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-xsaccessor-perl/current/lib/Class/XSAccessor/Array.pm?rev=61638&op=diff
==============================================================================
--- branches/upstream/libclass-xsaccessor-perl/current/lib/Class/XSAccessor/Array.pm (original)
+++ branches/upstream/libclass-xsaccessor-perl/current/lib/Class/XSAccessor/Array.pm Mon Aug 16 04:35:57 2010
@@ -5,7 +5,7 @@
use warnings;
use Carp qw/croak/;
-our $VERSION = '1.06';
+our $VERSION = '1.07';
require Class::XSAccessor;
require Class::XSAccessor::Heavy;
Modified: branches/upstream/libclass-xsaccessor-perl/current/lib/Class/XSAccessor/Heavy.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-xsaccessor-perl/current/lib/Class/XSAccessor/Heavy.pm?rev=61638&op=diff
==============================================================================
--- branches/upstream/libclass-xsaccessor-perl/current/lib/Class/XSAccessor/Heavy.pm (original)
+++ branches/upstream/libclass-xsaccessor-perl/current/lib/Class/XSAccessor/Heavy.pm Mon Aug 16 04:35:57 2010
@@ -5,7 +5,7 @@
use warnings;
use Carp;
-our $VERSION = '1.06';
+our $VERSION = '1.07';
our @CARP_NOT = qw(
Class::XSAccessor
Class::XSAccessor::Array
Added: branches/upstream/libclass-xsaccessor-perl/current/t/40hash_bad_call.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-xsaccessor-perl/current/t/40hash_bad_call.t?rev=61638&op=file
==============================================================================
--- branches/upstream/libclass-xsaccessor-perl/current/t/40hash_bad_call.t (added)
+++ branches/upstream/libclass-xsaccessor-perl/current/t/40hash_bad_call.t Mon Aug 16 04:35:57 2010
@@ -1,0 +1,54 @@
+use strict;
+use warnings;
+
+use Test::More tests => 13;
+
+BEGIN { use_ok('Class::XSAccessor') };
+
+package Hash;
+
+use Class::XSAccessor {
+ accessors => [ qw(foo bar) ],
+ constructor => 'new'
+};
+
+package main;
+
+my $hash = Hash->new();
+
+isa_ok $hash, 'Hash';
+can_ok $hash, 'foo', 'bar';
+
+$hash->foo('FOO');
+$hash->bar('BAR');
+
+is $hash->foo, 'FOO';
+is $hash->bar, 'BAR';
+
+eval { Hash->foo };
+
+like $@, qr{Class::XSAccessor: invalid instance method invocant: no hash ref supplied };
+
+eval { Hash->bar };
+
+like $@, qr{Class::XSAccessor: invalid instance method invocant: no hash ref supplied };
+
+eval { Hash::foo() };
+
+# package name introduced in 5.10.1
+like $@, qr{Usage: (Hash::)?foo\(self, \.\.\.\) };
+
+eval { Hash::bar() };
+
+like $@, qr{Usage: (Hash::)?bar\(self, \.\.\.\) };
+
+eval { Hash::foo( [] ) };
+
+like $@, qr{Class::XSAccessor: invalid instance method invocant: no hash ref supplied };
+
+eval { Hash::bar( '' ) };
+
+like $@, qr{Class::XSAccessor: invalid instance method invocant: no hash ref supplied };
+
+is Hash::foo($hash), 'FOO';
+is Hash::bar($hash), 'BAR';
Added: branches/upstream/libclass-xsaccessor-perl/current/t/41array_bad_call.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libclass-xsaccessor-perl/current/t/41array_bad_call.t?rev=61638&op=file
==============================================================================
--- branches/upstream/libclass-xsaccessor-perl/current/t/41array_bad_call.t (added)
+++ branches/upstream/libclass-xsaccessor-perl/current/t/41array_bad_call.t Mon Aug 16 04:35:57 2010
@@ -1,0 +1,57 @@
+use strict;
+use warnings;
+
+use Test::More tests => 13;
+
+BEGIN { use_ok('Class::XSAccessor') };
+
+package Array;
+
+use Class::XSAccessor::Array {
+ accessors => {
+ foo => 0,
+ bar => 1
+ },
+ constructor => 'new'
+};
+
+package main;
+
+my $array = Array->new();
+
+isa_ok $array, 'Array';
+can_ok $array, 'foo', 'bar';
+
+$array->foo('FOO');
+$array->bar('BAR');
+
+is $array->foo, 'FOO';
+is $array->bar, 'BAR';
+
+eval { Array->foo };
+
+like $@, qr{Class::XSAccessor: invalid instance method invocant: no array ref supplied };
+
+eval { Array->bar };
+
+like $@, qr{Class::XSAccessor: invalid instance method invocant: no array ref supplied };
+
+eval { Array::foo() };
+
+# package name introduced in 5.10.1
+like $@, qr{Usage: (Array::)?foo\(self, \.\.\.\) };
+
+eval { Array::bar() };
+
+like $@, qr{Usage: (Array::)?bar\(self, \.\.\.\) };
+
+eval { Array::foo( {} ) };
+
+like $@, qr{Class::XSAccessor: invalid instance method invocant: no array ref supplied };
+
+eval { Array::bar( '' ) };
+
+like $@, qr{Class::XSAccessor: invalid instance method invocant: no array ref supplied };
+
+is Array::foo($array), 'FOO';
+is Array::bar($array), 'BAR';
More information about the Pkg-perl-cvs-commits
mailing list