diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-10-29 08:59:33 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-10-29 21:50:24 -0700 |
commit | bc56db2a697ebe59892fabdcfa5aa910ed4f2885 (patch) | |
tree | 46baa9108d034489f57815f9bc213b728fdd938c | |
parent | 0c3bb3c2ad1fe4246d916a548cabaaa2590e7414 (diff) | |
download | perl-bc56db2a697ebe59892fabdcfa5aa910ed4f2885.tar.gz |
Add HvENAME
Add HvENAME as an alias for HvENAME_get and make it public.
This is now the preferred name for use in isa caches.
-rw-r--r-- | hv.h | 9 | ||||
-rw-r--r-- | pod/perlmroapi.pod | 12 |
2 files changed, 16 insertions, 5 deletions
@@ -179,6 +179,14 @@ Null HV pointer. Returns the package name of a stash, or NULL if C<stash> isn't a stash. See C<SvSTASH>, C<CvSTASH>. +=for apidoc Am|char*|HvENAME|HV* stash +Returns the effective name of a stash, or NULL if there is none. The +effective name represents a location in the symbol table where this stash +resides. It is updated automatically when packages are aliased or deleted. +A stash that is no longer in the symbol table has no effective name. This +name is preferable to C<HvNAME> for use in MRO linearisations and isa +caches. + =for apidoc Am|void*|HeKEY|HE* he Returns the actual pointer stored in the key slot of the hash entry. The pointer may be either C<char*> or C<SV*>, depending on the value of @@ -254,6 +262,7 @@ C<SV*>. #define HvRITER_get(hv) (SvOOK(hv) ? HvAUX(hv)->xhv_riter : -1) #define HvEITER_get(hv) (SvOOK(hv) ? HvAUX(hv)->xhv_eiter : NULL) #define HvNAME(hv) HvNAME_get(hv) +#define HvENAME(hv) HvENAME_get(hv) /* Checking that hv is a valid package stash is the caller's responsibility */ diff --git a/pod/perlmroapi.pod b/pod/perlmroapi.pod index 2200becded..f010b75449 100644 --- a/pod/perlmroapi.pod +++ b/pod/perlmroapi.pod @@ -54,11 +54,13 @@ function - the parameter is provided to allow your implementation to track depth if it needs to recurse. The function should return a reference to an array containing the parent -classes in order. The caller is responsible for incrementing the reference -count if it wants to keep the structure. Hence if you have created a -temporary value that you keep no pointer to, C<sv_2mortal()> to ensure that -it is disposed of correctly. If you have cached your return value, then -return a pointer to it without changing the reference count. +classes in order. The names of the classes should be the result of calling +C<HvENAME()> on the stash. The caller is responsible for incrementing the +reference count of the array returned if it wants to keep the structure. +Hence, if you have created a temporary value that you keep no pointer to, +C<sv_2mortal()> to ensure that it is disposed of correctly. If you have +cached your return value, then return a pointer to it without changing the +reference count. =head1 Caching |