summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-10-27 09:44:04 -0700
committerFather Chrysostomos <sprout@cpan.org>2010-10-27 09:45:26 -0700
commit78b79c7758384edd69ba966d2f0571855acb1117 (patch)
tree5804749f02e2f3d1440bc78bd3c684d31ff72202 /proto.h
parent13d356f324d3ac73ad7eb9e627a33e3fa89132ec (diff)
downloadperl-78b79c7758384edd69ba966d2f0571855acb1117.tar.gz
Renaming of stashes should not be visible from Perl
Change 35759254 made stashes get renamed when moved around. This had an unintended consequence: Typeglobs, ref() return values, stringifi- cation of blessed references and __PACKAGE__ are all affected by this. This commit makes a new distinction between stashes’ names and effect- ive names. Stash names are now unaffected when the stashes move around. Only the effective names are affected. (The apparent presence of any puns in the previous sentence is purely incidental and most likely the result of the reader’s inferential propensity.) To this end a new HvENAME_get macro is introduced, returning the first effective name (what HvNAME_get was returning). (Only one effective name needs to be in effect at a time.) hv_add_name and hv_delete_name have been renamed hv_add_ename and hv_delete_ename. hv_name_set is modified to leave the effective names in place unless the name is being set to NULL. These names are now stored in HvAUX as follows: When xhv_name_count is 0, xhv_name is a HEK pointer, containing the name which is also the effective name. When xhv_name_count is not zero, then xhv_name is a pointer to an array of HEK pointers. If xhv_name_count is positive, the first HEK is the name *and* one of the effective names. When xhv_name_count is negative, the first HEK is the name and subsequent HEKs are the effective names.
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/proto.h b/proto.h
index 144abe072c..0027180690 100644
--- a/proto.h
+++ b/proto.h
@@ -1262,6 +1262,18 @@ PERL_CALLCONV void Perl_hv_eiter_set(pTHX_ HV *hv, HE *eiter)
#define PERL_ARGS_ASSERT_HV_EITER_SET \
assert(hv)
+PERL_CALLCONV void Perl_hv_ename_add(pTHX_ HV *hv, const char *name, U32 len)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
+#define PERL_ARGS_ASSERT_HV_ENAME_ADD \
+ assert(hv); assert(name)
+
+PERL_CALLCONV void Perl_hv_ename_delete(pTHX_ HV *hv, const char *name, U32 len)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
+#define PERL_ARGS_ASSERT_HV_ENAME_DELETE \
+ assert(hv); assert(name)
+
/* PERL_CALLCONV bool Perl_hv_exists(pTHX_ HV *hv, const char *key, I32 klen)
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_2); */
@@ -1349,18 +1361,6 @@ PERL_CALLCONV void Perl_hv_ksplit(pTHX_ HV *hv, IV newmax)
#define PERL_ARGS_ASSERT_HV_MAGIC \
assert(hv)
-PERL_CALLCONV void Perl_hv_name_add(pTHX_ HV *hv, const char *name, U32 len)
- __attribute__nonnull__(pTHX_1)
- __attribute__nonnull__(pTHX_2);
-#define PERL_ARGS_ASSERT_HV_NAME_ADD \
- assert(hv); assert(name)
-
-PERL_CALLCONV void Perl_hv_name_delete(pTHX_ HV *hv, const char *name, U32 len)
- __attribute__nonnull__(pTHX_1)
- __attribute__nonnull__(pTHX_2);
-#define PERL_ARGS_ASSERT_HV_NAME_DELETE \
- assert(hv); assert(name)
-
PERL_CALLCONV void Perl_hv_name_set(pTHX_ HV *hv, const char *name, U32 len, U32 flags)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_HV_NAME_SET \