On Wed, Mar 26, 2014 at 2:30 PM, Zefram <zefram@fysh.org> wrote: > 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. Fragile yes, but sufficient so far. I could store a blessed object as ref to a blessed object, and the inner object can be easier identified then. But which stash name or magic to choose then? -- Reini Urban http://cpanel.net/ http://www.perl-compiler.org/Thread Previous