[Bast-commits] r9197 - in trunk/Class-Accessor-Grouped: .
lib/Class/Accessor
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Fri Apr 23 22:45:35 GMT 2010
Author: ribasushi
Date: 2010-04-23 23:45:35 +0100 (Fri, 23 Apr 2010)
New Revision: 9197
Modified:
trunk/Class-Accessor-Grouped/Changes
trunk/Class-Accessor-Grouped/lib/Class/Accessor/Grouped.pm
Log:
XSAccessor fixes
Modified: trunk/Class-Accessor-Grouped/Changes
===================================================================
--- trunk/Class-Accessor-Grouped/Changes 2010-04-22 10:46:20 UTC (rev 9196)
+++ trunk/Class-Accessor-Grouped/Changes 2010-04-23 22:45:35 UTC (rev 9197)
@@ -1,5 +1,7 @@
Revision history for Class::Accessor::Grouped.
+ - make the Class::XSAccessor more intelligent, add documentation
+
0.09002 Tue Oct 20 23:16:28 2009
- removing Class::XSAccessor usage for now
Modified: trunk/Class-Accessor-Grouped/lib/Class/Accessor/Grouped.pm
===================================================================
--- trunk/Class-Accessor-Grouped/lib/Class/Accessor/Grouped.pm 2010-04-22 10:46:20 UTC (rev 9196)
+++ trunk/Class-Accessor-Grouped/lib/Class/Accessor/Grouped.pm 2010-04-23 22:45:35 UTC (rev 9197)
@@ -10,6 +10,25 @@
our $VERSION = '0.09002';
$VERSION = eval $VERSION;
+# Class::XSAccessor is segfaulting on win32, so be careful
+# Win32 users can set $hasXS to try to use it anyway
+our $hasXS;
+sub _hasXS {
+
+ if (not defined $hasXS) {
+ $hasXS = 0;
+
+ if ($^O ne 'MSWin32') {
+ eval {
+ require Class::XSAccessor;
+ $hasXS = 1;
+ };
+ }
+ }
+
+ return $hasXS;
+}
+
=head1 NAME
Class::Accessor::Grouped - Lets you build groups of accessors
@@ -438,30 +457,17 @@
return @{mro::get_linear_isa($class)};
};
-# This is now a hard, rather than optional dep. Since we dep on Sub::Name, we no
-# longer care about not using XS modules.
+1;
-# Class::XSAccessor is segfaulting in some places, so removing for now.
-{
- our $hasXS;
+=head1 Performance
- sub _hasXS { 0 }
+You can speed up accessors of type 'simple' by installing L<Class::XSAccessor>.
+Note however that the use of this module is disabled by default on Win32
+systems, as it causes yet untracked segfaults. If you are a Win32 user, and
+want to try this module with L<Class::XSAccessor>, set
+C<$Class::Accessor::Grouped::hasXS> to a true value B<before> registering
+your accessors (e.g. in a C<BEGIN> block)
-# sub _hasXS {
-# return $hasXS if defined $hasXS;
-#
-# $hasXS = 0;
-# eval {
-# require Class::XSAccessor;
-# $hasXS = 1;
-# };
-#
-# return $hasXS;
-# }
-}
-
-1;
-
=head1 AUTHORS
Matt S. Trout <mst at shadowcatsystems.co.uk>
More information about the Bast-commits
mailing list