Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PMCs and UnionVal

4 views
Skip to first unread message

Leopold Toetsch

unread,
Aug 27, 2003, 11:29:09 AM8/27/03
to P6I
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

Dan Sugalski

unread,
Aug 27, 2003, 11:37:22 AM8/27/03
to Leopold Toetsch, P6I
On Wed, 27 Aug 2003, Leopold Toetsch wrote:

> This would give us one additional pointer.
>

> Comments welcome

Go for it. This won't increase the size of the struct, so I can't think of
a good reason to not do it.

Dan

Leopold Toetsch

unread,
Aug 27, 2003, 3:16:57 PM8/27/03
to Dan Sugalski, perl6-i...@perl.org

Done (modulo jit_debug stabs)

> Dan

leo

0 new messages