}
static int
-mouse_xc_is_fresh(aTHX_ AV* const xc) {
+mouse_xc_is_fresh(pTHX_ AV* const xc) {
HV* const stash = MOUSE_xc_stash(xc);
SV* const gen = MOUSE_xc_gen(xc);
if(SvUVX(gen) != 0U && MOUSE_xc_flags(xc) & MOUSEf_XC_IS_IMMUTABLE) {
return SvUVX(gen) == mro_get_pkg_gen(stash);
}
-static AV*
+STATIC_INLINE AV*
mouse_get_xc(pTHX_ SV* const metaclass) {
AV* const xc = mouse_get_xc_wo_check(aTHX_ metaclass);
return mouse_xc_is_fresh(aTHX_ xc)
mouse_class_initialize_object(aTHX_ meta, object, args, is_cloning);
}
+void
+_invalidate_metaclass_cache(SV* meta)
+CODE:
+{
+ AV* const xc = mouse_get_xc_if_fresh(aTHX_ meta);
+ if(xc) {
+ SV* const gen = MOUSE_xc_gen(xc);
+ sv_setuv(gen, 0U);
+ }
+ delete_slot(meta, newSVpvs_flags("_mouse_cache_", SVs_TEMP));
+}
+
+
MODULE = Mouse PACKAGE = Mouse::Meta::Role
BOOT: