interface dispatch
Godmar Back
gback@cs.utah.edu
Sun Oct 24 09:04:00 GMT 1999
>
> Godmar Back <gback@cs.utah.edu> writes:
>
> > Oh, okay, I see, you could define
> >
> > typedef struct {
> > Hjava_lang_Class *iface;
> > methodptr *meth[1];
> > } *partialiftable;
> > in this case too.
>
> Yes, but that adds an extra level indirection, which is to be
> avoided if possible.
No. I guess I wasn't clear enough. I meant this only as syntactic
sugar, the memory layout being identical. If methodptr is typedef'd
as void *, it should actually have been:
methodptr meth[1];
to express a variable-length array that's part of the structure.
- Godmar
More information about the Java
mailing list