Checking in changes prior to tagging of version 0.40_06. Changelog diff is:
[gitmo/Mouse.git] / lib / Mouse / Meta / Module.pm
index 76f704c..ab2fd6a 100755 (executable)
@@ -1,13 +1,19 @@
 package Mouse::Meta::Module;
 use Mouse::Util qw/:meta get_code_package get_code_ref load_class not_supported/; # enables strict and warnings
 
-use Mouse::Util::TypeConstraints ();
-
 use Carp         ();
 use Scalar::Util ();
 
 my %METAS;
 
+if(Mouse::Util::_MOUSE_XS){
+    # register meta storage for performance
+    Mouse::Util::__register_metaclass_storage(\%METAS, 0);
+
+    # ensure thread safety
+    *CLONE = sub { Mouse::Util::__register_metaclass_storage(\%METAS, 1) };
+}
+
 sub _metaclass_cache { # DEPRECATED
     my($class, $name) = @_;
     return $METAS{$name};
@@ -66,9 +72,11 @@ sub get_attribute_map { # DEPRECATED
 
 sub has_attribute     { exists $_[0]->{attributes}->{$_[1]} }
 sub get_attribute     {        $_[0]->{attributes}->{$_[1]} }
-sub get_attribute_list{ keys %{$_[0]->{attributes}}         }
 sub remove_attribute  { delete $_[0]->{attributes}->{$_[1]} }
 
+sub get_attribute_list{ keys   %{$_[0]->{attributes}} }
+
+
 # XXX: for backward compatibility
 my %foreign = map{ $_ => undef } qw(
     Mouse Mouse::Role Mouse::Util Mouse::Util::TypeConstraints
@@ -143,7 +151,7 @@ sub get_method_list {
 
         my $superclasses;
         if(exists $options{superclasses}){
-            if(Mouse::Util::TypeConstraints::_is_a_metarole($self)){
+            if(Mouse::Util::is_a_metarole($self)){
                 delete $options{superclasses};
             }
             else{
@@ -290,7 +298,7 @@ Mouse::Meta::Module - The base class for Mouse::Meta::Class and Mouse::Meta::Rol
 
 =head1 VERSION
 
-This document describes Mouse version 0.40_03
+This document describes Mouse version 0.40_06
 
 =head1 SEE ALSO