Dan Sugalski <[EMAIL PROTECTED]> wrote:
[ PObj union ]
> Still, point taken. That needs to die and it needs to die now. For
> the moment, lets split it into two pieces, a buffer pointer and an
> int/float union, so we don't have to guess whether the contents have
> issues with threads.
The Buffer members (bufstart, buflen) of the union are never used for a
PMC. Also a PMC can't get converted into a Buffer or vv. These union
members are just there for DOD, so that one pobject_lives() (and other
functions) can be used for both PMCs and Buffers. That was introduced
when uniting Buffers and PMCs.
I don't see a problem with that.
The problem that Gordon expressed with morph is:
thread1 thread2
PerlInt->vtable->set_string_native
(int_val = 3)
LOCK()
perlscalar->vtable->morph:
pmc->vtable is now a PerlString
vtable, str_val is invalid
read access on pmc - non-locked
PerlString->vtable->get_integer
STRING *s = pmc->str_val
SIGBUS/SEGV on access of s
But that can be solved by first clearing str_val, then changing the
vtable.
leo