The current layout of all PObjs has a C<UnionVal u> which looks like: typedef union UnionVal { INTVAL int_val; /* PMC unionval members */ FLOATVAL num_val; DPOINTER* struct_val; struct parrot_string_t * string_val; PMC* pmc_val; struct { /* Buffers structure */ void * bufstart; size_t buflen; } b; } UnionVal;
It should be better something like:
typedef union UnionVal { INTVAL int_val; /* PMC unionval members */ FLOATVAL num_val; struct parrot_string_t * string_val; struct { DPOINTER* struct_val; PMC* pmc_val; } ptrs; struct { /* Buffers structure */ void * bufstart; size_t buflen; } b; } UnionVal;
This would give us one additional pointer. PMCs that currently use e.g. struct_val + data could use this, so that the PMC_EXT with the data pointer hasn't to be allocated.
We could also move {bufstart, buflen} in front, so that we could approach the constant STRING issue.
Comments welcome leo