From: gfx Date: Fri, 18 Dec 2009 06:13:27 +0000 (+0900) Subject: Move is_immutable into XS X-Git-Tag: 0.45~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=80efe91126e926233fade8bdd58288929286fc09;p=gitmo%2FMouse.git Move is_immutable into XS --- diff --git a/lib/Mouse/Meta/Class.pm b/lib/Mouse/Meta/Class.pm index 08bb9d3..c28e13b 100644 --- a/lib/Mouse/Meta/Class.pm +++ b/lib/Mouse/Meta/Class.pm @@ -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 ) = @_; diff --git a/lib/Mouse/PurePerl.pm b/lib/Mouse/PurePerl.pm index 5741014..80537c9 100644 --- a/lib/Mouse/PurePerl.pm +++ b/lib/Mouse/PurePerl.pm @@ -317,6 +317,7 @@ sub _initialize_object{ return; } +sub is_immutable { $_[0]->{is_immutable} } package Mouse::Meta::Role; diff --git a/xs-src/Mouse.xs b/xs-src/Mouse.xs index 5cbfb80..b3d411c 100644 --- a/xs-src/Mouse.xs +++ b/xs-src/Mouse.xs @@ -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");