summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-09-12 00:19:51 +0000
committerNicholas Clark <nick@ccl4.org>2008-09-12 00:19:51 +0000
commita49ba3fcbe357fbacf7b9898df08daa2cbdfc8c4 (patch)
tree43834e70391760038633daf86cecae00b95fef4e /hv.h
parentc109477dfda0dedbe3c4ffa3d6074085d3b8497a (diff)
downloadperl-a49ba3fcbe357fbacf7b9898df08daa2cbdfc8c4.tar.gz
Create a direct lookup hash for ->isa() lookup, by retaining the
de-duping hash used by S_mro_get_linear_isa_dfs(). Provide a new function Perl_get_isa_hash() to lazily retrieve this. (Which could actually be static if S_isa_lookup() and Perl_sv_derived_from() moved into mro.c.) Make S_isa_lookup() use this lookup hash in place of a linear walk of the linear isa. This should turn isa lookups from O(n) to O(1), which should make heavy users of ->isa() faster. (eg PPI, and hence Perl Critic). p4raw-id: //depot/perl@34354
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/hv.h b/hv.h
index e7d0c762ff..7f96a1357b 100644
--- a/hv.h
+++ b/hv.h
@@ -52,6 +52,7 @@ struct mro_meta {
U32 cache_gen; /* Bumping this invalidates our method cache */
U32 pkg_gen; /* Bumps when local methods/@ISA change */
const struct mro_alg *mro_which; /* which mro alg is in use? */
+ HV *isa; /* Everything this class @ISA */
};
/* Subject to change.