On Tue, Jun 5, 2012 at 11:16 AM, Father Chrysostomos via RT wrote:On Tue Jun 05 08:52:54 2012, reini@cpanel.net wrote:On 06/04/2012 01:25 AM, Father Chrysostomos via RT wrote:On Sun Oct 31 17:16:43 2010, sprout wrote:
Threaded:
$ perl -le' package bar; *foo:: = *bar::; *bar:: = *baz::; print eval
"__PACKAGE__"'
baz
Unthreaded:
$ perl -le' package bar; *foo:: = *bar::; *bar:: = *baz::; print eval
"__PACKAGE__"'
bar
I think the latter is correct.
I have a partially-written fix (I’m still getting assertion failures)
for this on the smoke-me/copstash branch.
It replaces cop->cop_stashpv and cop_stashlen with cop_stashoff, that
points to an offset in the newly-added PL_stashpad array.
In order to get B to compile, I had to comment out the stashpv method.
How low-level is B supposed to be? Should I replace stashpv with
stashoff? Or should I simply provide B::COP::stash for both threaded
and non-threaded perls, and not expose the fact that it uses an offset
in PL_stashpad?
Ad B:
Since I have to recreate the new PL_stashpad in B::C, Byteloader and
friends I need B::COP::stashoff exposed.
Having reliable public readers and writers for B::COP::stash would also
help, but I don't trust p5p's reliability on such low-level APIs.
Now the string API is gone and we have hashes again.
I rather do it by myself, as p5p tends to break the low-level APIs very
often and refuse to fix it later.
You are being awfully vague. I’m perfectly willing to accommodate the
needs of B::C, but I don’t understand what you need.
Does B::C need access to all of perl’s innards, such that we can’t even
fix bugs?
I never said that. On the contrary I would like to get bug fixed,
but they are typically warnocked for about two major releases until
they get fixed.
I said that I need either a reliable public API to read+write new data,
or expose the innards so that I can do it by myself.
There's also no need for a deprecation cycle for those innards.
What about CopSTASH_set, CopSTASH_len and CopSTASH_len_set? They were
public API's from cop.h.
They were only ‘public’ in the sense that they had to be accessible for
the CopSTASH macro to work. They were never documented in perlapi.
I'm fine with that since I don't need them.
But others with the expectation of deprecation cycles might need them.
Ad stashpad:
Why a new pad anyway?
Using the lexical pad results in very fragile code, because PL_curstash
has to be set before CopSTASH can be used.
Why not keep the stash names in PL_strtab
(sharedpvn) with threads?
Using strings at all causes bugs like the one quoted at the beginning of
this message.
I see, agreed.
stashoff is faster, indeed, but I assume also more complicate to handle.
On comparison: The similar handled regex_padav is still broken threaded
in the compiler, it should really be moved to the REGEXP body.
How is it broken?
I don't know yet.
my_perl->regex_padav gets overwritten in the first call to Perl_call_pv@plt
which looks like loading a shared library section. I haven't
disassembled it yet.
Logically I thought it has something to do with body arena init, but
it does not look like so.
It is compiler independent and repro. The rest of my_perl seems to be
not affected.
http://code.google.com/p/perl-compiler/issues/detail?id=100stashpad seems very alike so I'm sceptical. We'll see.