Move is_immutable into XS
gfx [Fri, 18 Dec 2009 06:13:27 +0000 (15:13 +0900)]
lib/Mouse/Meta/Class.pm
lib/Mouse/PurePerl.pm
xs-src/Mouse.xs

index 08bb9d3..c28e13b 100644 (file)
@@ -270,8 +270,8 @@ sub make_mutable {
     return;
 }
 
-sub is_immutable {  $_[0]->{is_immutable} }
-sub is_mutable   { !$_[0]->{is_immutable} }
+sub is_immutable;
+sub is_mutable   { !$_[0]->is_immutable }
 
 sub _install_modifier_pp{
     my( $self, $type, $name, $code ) = @_;
index 5741014..80537c9 100644 (file)
@@ -317,6 +317,7 @@ sub _initialize_object{
     return;
 }
 
+sub is_immutable {  $_[0]->{is_immutable} }
 
 package
     Mouse::Meta::Role;
index 5cbfb80..b3d411c 100644 (file)
@@ -454,6 +454,7 @@ MODULE = Mouse  PACKAGE = Mouse::Meta::Class
 BOOT:
     INSTALL_SIMPLE_READER(Class, roles);
     INSTALL_SIMPLE_PREDICATE_WITH_KEY(Class, is_anon_class, anon_serial_id);
+    INSTALL_SIMPLE_READER(Class, is_immutable);
 
     INSTALL_CLASS_HOLDER(Class, method_metaclass,     "Mouse::Meta::Method");
     INSTALL_CLASS_HOLDER(Class, attribute_metaclass,  "Mouse::Meta::Attribute");