RE: [AD] 4.3 graphic drivers |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: <alleg-developers@xxxxxxxxxx>
- Subject: RE: [AD] 4.3 graphic drivers
- From: "Robert Ohannessian" <ROhannessian@xxxxxxxxxx>
- Date: Fri, 11 Nov 2005 10:17:03 -0800
- Thread-index: AcXmwiqUxLkO4TA+Q+i7Kpy+MFGCcwAKcgQw
- Thread-topic: [AD] 4.3 graphic drivers
AGL wants to dynamically rewrite the vtable. I'd like whichever scheme
we end up with to support this.
> -----Original Message-----
> From: alleg-developers-admin@xxxxxxxxxx [mailto:alleg-
> developers-admin@xxxxxxxxxx] On Behalf Of Peter Wang
> Sent: Friday, November 11, 2005 7:17 AM
> To: alleg-developers@xxxxxxxxxx
> Subject: Re: [AD] 4.3 graphic drivers
>
> On 2005-11-11, Elias Pschernig <elias@xxxxxxxxxx> wrote:
> > On Fri, 2005-11-11 at 22:38 +1100, Peter Wang wrote:
> > >
> > > register_vtable_v1() would need to adapt V1 vtables to V2:
> > >
> > > void register_vtable_v1(VTABLE_V1 *v1)
> > > {
> > > VTABLE_V2 *v2 = allocate_v2_vtable();
> > > v2->v1_vtable = v1;
> > > v2->new_method = NULL;
> > > v2->some_method = v1_some_method_adaptor;
> > > }
> > >
> > > I'm not sure where v1_some_method_adaptor is going to get the
address
> of
> > > v1->some_method from. Presumably the same place as all the other
> > > suggestions so far. Once we decide V1 compatibility is no longer
> > > needed, it can be thrown out.
> >
> > Maybe each VTABLE needs a pointer to all the predecessors?
>
> That's what I was thinking with the field `v2->v1_table'. It would be
a
> bit ugly as we want drivers to fill in VTABLE_V2 instances statically,
> but they would need to leave a blank slot for where the v1_vtable
field
> would go.
>
> But the question remains, where does `v1_some_method_adaptor' get the
> address of `v2->v1_vtable' from? It has the function signature of
> `some_method' so the vtable is not available from its arguments.
> Presumably the currently used vtable will be stored in a global, or
each
> adaptor function will have a corresponding global variable pointing to
> the function that it should call. Those options only work if one
vtable
> is in use at a time.
>
> In some cases an argument might be an object with a pointer to its own
> vtable. And we have the option of simply passing the vtable to all
> methods, but that is really ugly. How were the other proposals going
to
> handle this?
>
> Peter
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server.
> Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
> --
> https://lists.sourceforge.net/lists/listinfo/alleg-developers