summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2014-12-25 01:33:42 +0100
committerYves Orton <demerphq@gmail.com>2014-12-25 01:34:39 +0100
commiteaab56493bda8d2c9e499f01433ea2da9b29f6e5 (patch)
treef52f9654540bc436cf4482d0dfe54e65410158bc /proto.h
parentcced55d2e366f8ccb0884e747f32c32c1b538989 (diff)
downloadperl-eaab56493bda8d2c9e499f01433ea2da9b29f6e5.tar.gz
add new API function sv_get_backrefs()
This encapsulates the logic to extract the backrefs from a weak-referent. Since sv_get_backrefs() can be used for a similar purposes as hv_backreferences_p() we no longer need to export the later, and therefore this patch also reverts ad2f46a793b4ade67d45ac0086ae62f6756c2752. See perl #123473 for related discussion, and https://github.com/Sereal/Sereal/issues/73 for a practical example of why this API is required.
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/proto.h b/proto.h
index ce86fcabcf..c27e50b90b 100644
--- a/proto.h
+++ b/proto.h
@@ -4379,6 +4379,12 @@ PERL_CALLCONV void Perl_sv_free2(pTHX_ SV *const sv, const U32 refcnt)
assert(sv)
PERL_CALLCONV void Perl_sv_free_arenas(pTHX);
+PERL_CALLCONV SV* Perl_sv_get_backrefs(pTHX_ SV *const sv)
+ __attribute__pure__
+ __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT_SV_GET_BACKREFS \
+ assert(sv)
+
PERL_CALLCONV char* Perl_sv_gets(pTHX_ SV *const sv, PerlIO *const fp, I32 append)
__attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_2);