summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-09-26 10:21:50 +0000
committerNicholas Clark <nick@ccl4.org>2007-09-26 10:21:50 +0000
commit3d76853f2ba25cc9699cf098371070e4651e154f (patch)
tree642530689aef60363b778e613095b897ee359ed4 /hv.h
parent6f47696963057ac118d1f5f49ebe66a858dd9e42 (diff)
downloadperl-3d76853f2ba25cc9699cf098371070e4651e154f.tar.gz
Change the way of determining the MRO algorithm used from an enum
defined in the header, to a pointer to a structure. This allows the flexibility to easily add more MROs in the future, and to provide an API to do so. Dispatch in mro.c is now via the structure pointed to, rather than switch statements on the value of the enum. p4raw-id: //depot/perl@31977
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/hv.h b/hv.h
index 163c660db6..b8d6b7d243 100644
--- a/hv.h
+++ b/hv.h
@@ -41,10 +41,9 @@ struct shared_he {
Use the funcs in mro.c
*/
-typedef enum {
- MRO_DFS, /* 0 */
- MRO_C3 /* 1 */
-} mro_alg;
+
+/* structure may change, so not public yet */
+struct mro_alg;
struct mro_meta {
AV *mro_linear_dfs; /* cached dfs @ISA linearization */
@@ -52,7 +51,7 @@ struct mro_meta {
HV *mro_nextmethod; /* next::method caching */
U32 cache_gen; /* Bumping this invalidates our method cache */
U32 pkg_gen; /* Bumps when local methods/@ISA change */
- mro_alg mro_which; /* which mro alg is in use? */
+ const struct mro_alg *mro_which; /* which mro alg is in use? */
};
/* Subject to change.