At 10:50 AM -0500 1/24/04, Gordon Henriksen wrote:
On Saturday, January 24, 2004, at 09:23 , Leopold Toetsch wrote:

Gordon Henriksen <[EMAIL PROTECTED]> wrote:

... Best example: morph. morph must die.

Morph is necessary. But please note: morph changes the vtable of the PMC to point to the new data types table. It has nothing to do with a typed union.

The vtable IS the discriminator. I'm referring to this:


        typedef union UnionVal {
            struct {                    /* Buffers structure */
                void * bufstart;
                size_t buflen;
            } b;
            struct {                    /* PMC unionval members */
                DPOINTER* _struct_val;   /* two ptrs, both are defines */
                PMC* _pmc_val;
            } ptrs;
            INTVAL int_val;
            FLOATVAL num_val;
            struct parrot_string_t * string_val;
        } UnionVal;

So long as the discriminator does not change, the union is type stable.

The vtable's not the discriminator there, the flags in the pmc are the discriminator, as they're what indicates that the union's a GCable thing or not. I will admit, though, that looks *very* different than it did when I put that stuff in originally. (It used to be just a union of FLOATVAL, INTVAL, and string pointer...)


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.
--
Dan


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to