I will start $subject soon. This will generate a lot of changes in CVS.
The basic common structure will be a Parrot Object or PObj for short.
To get there, the first step will be hiding affected structure members
inside some accessor macros and unification of PMC/Buffer flags.
(When this is done, changing below structures to our needs should be
really simple)
The involved structures will be something like this finally:
typedef union UnionVal {
struct { /* for 32 bit ints, 64 bit double */
Parrot_Int int_val[2]; /* the 2nd int_val might be useful for */
} i; /* e.g. {nom/denom} floats */
Parrot_Float num_val; /* PMCs UnionVal members */
Parrot_Pointer struct_val;
struct STRING* string_val;
struct PMC* pmc_val;
struct { /* Buffers structure */
void * bufstart;
size_t buflen;
} b;
} UnionVal;
/* Parrot Object - base class for all others */
typedef struct PObj {
UnionVal u;
Parrot_UInt flags;
} PObj;
/* plain Buffer is the smallest Parrot Obj */
typedef struct Buffer {
PObj o;
} Buffer;
/* a scalar PMC is a Parrot Object with a VTABLE */
typedef struct PMC {
PObj o;
nVTABLE *vtable;
} PMC;
For the full story please read (again) these threads starting with
Subjects:
- [RFC] Buffer/PMC unification, variable/value vtable split, tied scalars
- Of PMCs Buffers and memory management
leo
- Re: [INFO] Buffer/PMC unification Leopold Toetsch
- Re: [INFO] Buffer/PMC unification Leopold Toetsch
- Re: [INFO] Buffer/PMC unification Leopold Toetsch
- Re: [INFO] Buffer/PMC unification Leopold Toetsch
- Re: [INFO] Buffer/PMC unification Leopold Toetsch
- Re: [INFO] Buffer/PMC unification Leopold Toetsch
- Re: [INFO] Buffer/PMC unification Dan Sugalski
- Re: [INFO] Buffer/PMC unification Leopold Toetsch
- [INFO] Buffer/PMC unification - #7 and finito for now Leopold Toetsch