Moose
view release on metacpan or search on metacpan
xs/HasMethods.xs view on Meta::CPAN
void
_method_map(self)
SV *self
PREINIT:
HV *const obj = (HV *)SvRV(self);
SV *const class_name = HeVAL( hv_fetch_ent(obj, KEY_FOR(package), 0, HASH_FOR(package)) );
HV *const stash = gv_stashsv(class_name, 0);
UV current;
SV *cache_flag;
SV *map_ref;
PPCODE:
if (!stash) {
mXPUSHs(newRV_noinc((SV *)newHV()));
return;
}
current = mop_check_package_cache_flag(aTHX_ stash);
cache_flag = HeVAL( hv_fetch_ent(obj, KEY_FOR(package_cache_flag), TRUE, HASH_FOR(package_cache_flag)));
map_ref = HeVAL( hv_fetch_ent(obj, KEY_FOR(methods), TRUE, HASH_FOR(methods)));
/* $self->{methods} does not yet exist (or got deleted) */
PROTOTYPES: DISABLE
# use prototype here to be compatible with get_code_info from Sub::Identify
void
get_code_info(coderef)
SV *coderef
PROTOTYPE: $
PREINIT:
char *pkg = NULL;
char *name = NULL;
PPCODE:
SvGETMAGIC(coderef);
if (mop_get_code_info(coderef, &pkg, &name)) {
EXTEND(SP, 2);
mPUSHs(newSVpv(pkg, 0));
mPUSHs(newSVpv(name, 0));
}
( run in 2.126 seconds using v1.01-cache-2.11-cpan-71847e10f99 )