diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-12-27 11:05:03 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-12-27 21:12:13 +0000 |
commit | 3a6fa573ae4863261f94be7a4dad29a13b1652be (patch) | |
tree | 141482451ba5c4b1b2647e078c458ea21e2935e1 /mro.c | |
parent | 31b9005d8ff165a414c5e3493027e1656d7e810f (diff) | |
download | perl-3a6fa573ae4863261f94be7a4dad29a13b1652be.tar.gz |
In struct mro_meta, rename mro_linear_c3 to mro_linear_current, and change it
from AV * to SV *.
Diffstat (limited to 'mro.c')
-rw-r--r-- | mro.c | 41 |
1 files changed, 21 insertions, 20 deletions
@@ -46,7 +46,7 @@ Perl_mro_get_private_data(pTHX_ struct mro_meta *const smeta, /* If we've been asked to look up the private data for the current MRO, then cache it. */ if (smeta->mro_which == which) - smeta->mro_linear_c3 = MUTABLE_AV(*data); + smeta->mro_linear_current = *data; return *data; } @@ -62,7 +62,7 @@ Perl_mro_set_private_data(pTHX_ struct mro_meta *const smeta, /* If all we need to store is the current MRO's data, then don't use memory on a hash with 1 element - store it direct, and signal this by leaving the would-be-hash NULL. */ - smeta->mro_linear_c3 = MUTABLE_AV(data); + smeta->mro_linear_current = data; return data; } else { HV *const hv = newHV(); @@ -70,11 +70,11 @@ Perl_mro_set_private_data(pTHX_ struct mro_meta *const smeta, HvMAX(hv) = 1; smeta->mro_linear_dfs = MUTABLE_AV(hv); - if (smeta->mro_linear_c3) { + if (smeta->mro_linear_current) { /* If we were storing something directly, put it in the hash before we lose it. */ Perl_mro_set_private_data(aTHX_ smeta, smeta->mro_which, - MUTABLE_SV(smeta->mro_linear_c3)); + smeta->mro_linear_current); } } } @@ -85,7 +85,7 @@ Perl_mro_set_private_data(pTHX_ struct mro_meta *const smeta, if (smeta->mro_which == which) { /* If we've been asked to store the private data for the current MRO, then cache it. */ - smeta->mro_linear_c3 = MUTABLE_AV(data); + smeta->mro_linear_current = data; } if (!Perl_hv_common(aTHX_ MUTABLE_HV(smeta->mro_linear_dfs), NULL, @@ -165,11 +165,12 @@ Perl_mro_meta_dup(pTHX_ struct mro_meta* smeta, CLONE_PARAMS* param) = MUTABLE_AV(SvREFCNT_inc(sv_dup((const SV *)newmeta->mro_linear_dfs, param))); /* This is just acting as a shortcut pointer, and will be automatically updated on the first get. */ - newmeta->mro_linear_c3 = NULL; - } else if (newmeta->mro_linear_c3) { + newmeta->mro_linear_current = NULL; + } else if (newmeta->mro_linear_current) { /* Only the current MRO is stored, so this owns the data. */ - newmeta->mro_linear_c3 - = MUTABLE_AV(SvREFCNT_inc(sv_dup((const SV *)newmeta->mro_linear_c3, param))); + newmeta->mro_linear_current + = SvREFCNT_inc(sv_dup((const SV *)newmeta->mro_linear_current, + param)); } if (newmeta->mro_nextmethod) @@ -438,11 +439,11 @@ Perl_mro_isa_changed_in(pTHX_ HV* stash) SvREFCNT_dec(MUTABLE_SV(meta->mro_linear_dfs)); meta->mro_linear_dfs = NULL; /* This is just acting as a shortcut pointer. */ - meta->mro_linear_c3 = NULL; - } else if (meta->mro_linear_c3) { + meta->mro_linear_current = NULL; + } else if (meta->mro_linear_current) { /* Only the current MRO is stored, so this owns the data. */ - SvREFCNT_dec(MUTABLE_SV(meta->mro_linear_c3)); - meta->mro_linear_c3 = NULL; + SvREFCNT_dec(meta->mro_linear_current); + meta->mro_linear_current = NULL; } if (meta->isa) { SvREFCNT_dec(meta->isa); @@ -487,11 +488,11 @@ Perl_mro_isa_changed_in(pTHX_ HV* stash) SvREFCNT_dec(MUTABLE_SV(revmeta->mro_linear_dfs)); revmeta->mro_linear_dfs = NULL; /* This is just acting as a shortcut pointer. */ - revmeta->mro_linear_c3 = NULL; - } else if (revmeta->mro_linear_c3) { + revmeta->mro_linear_current = NULL; + } else if (revmeta->mro_linear_current) { /* Only the current MRO is stored, so this owns the data. */ - SvREFCNT_dec(MUTABLE_SV(revmeta->mro_linear_c3)); - revmeta->mro_linear_c3 = NULL; + SvREFCNT_dec(revmeta->mro_linear_current); + revmeta->mro_linear_current = NULL; } if(!is_universal) revmeta->cache_gen++; @@ -630,15 +631,15 @@ Perl_mro_set_mro(pTHX_ struct mro_meta *const meta, SV *const name) Perl_croak(aTHX_ "Invalid mro name: '%"SVf"'", name); if(meta->mro_which != which) { - if (meta->mro_linear_c3 && !meta->mro_linear_dfs) { + if (meta->mro_linear_current && !meta->mro_linear_dfs) { /* If we were storing something directly, put it in the hash before we lose it. */ Perl_mro_set_private_data(aTHX_ meta, meta->mro_which, - MUTABLE_SV(meta->mro_linear_c3)); + MUTABLE_SV(meta->mro_linear_current)); } meta->mro_which = which; /* Scrub our cached pointer to the private data. */ - meta->mro_linear_c3 = NULL; + meta->mro_linear_current = NULL; /* Only affects local method cache, not even child classes */ meta->cache_gen++; |