develooper Front page | perl.perl5.porters | Postings from March 2014

Re: New API to store symbol names along pointers to symbols sharedlibs

Thread Previous | Thread Next
From:
Zefram
Date:
March 26, 2014 19:30
Subject:
Re: New API to store symbol names along pointers to symbols sharedlibs
Message ID:
20140326193042.GP18071@fysh.org
Reini Urban wrote:
> handle = dlopen(sofile("Encode"), RTLD_NOW|RTLD_NOLOAD);
> ptr = dlsym(handle, name);
> xpvmg_list[0].xiv_iv = PTR2IV(ptr);

Way too specific.  Pointing to C data structures from IV slots is a
common pattern, sure, but even in the relatively unusual case where the
data structures are statically allocated there's no reason to expect
that the pointer would correspond to an external-linkage symbol in the
module's .so.  That they do in the case of Encode is an accident of
implementation, not an architectural necessity.

-zefram

Thread Previous | Thread Next


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