develooper Front page | perl.perl5.porters | Postings from January 2018

Re: CvNAME_HEK_set() - public API?

Thread Previous
From:
Father Chrysostomos
Date:
January 25, 2018 17:52
Subject:
Re: CvNAME_HEK_set() - public API?
Message ID:
20180125175157.2652.qmail@lists-nntp.develooper.com
Paul Evans wrote:
> Update: it only appears to work fine on ELF-based platforms, because
> the symbol Perl_unshare_hek() is necessarily visible. On e.g. MSWin32
> it isn't, and it fails linking:
> 
>   lib\Future\AsyncAwait.o:AsyncAwait.c:(.text+0x2790): undefined
>   reference to `_imp__Perl_unshare_hek'
> 
> I notice that embed.fnc declares this without A or X flags:
> 
>   p       |void   |unshare_hek    |NULLOK HEK* hek
> 
> What are my options here?

Well, short of copying and pasting Perl_unshare_hek and
S_unshare_hek_or_pvn from hv.c, I am not sure that there is any choice
left but to avoid the need for unshare_hek.

Do any of the CVs you are cloning have HEKs?  At least in recent
perls, CvGV should vivify a GV and eliminate any HEK that the CV
points to.  Will that work for you?

In the current implementation, the HEK pointed to by a CV is shorthand
for a GV.  More precisely, CvSTASH + hek == GV.  You might want to
review the branch merged into blead as v5.21.3-662-gf9d9e96.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About