There is precedent for including a pointer to the function pointer table in each top level object. The OpenIB stack does this; each IB object (ib_pd, ib_qp, ib_mr, etc.) contain a pointer to the ib_device structure. Of course I know that just because it was done before doesn't make it right.

james

On Mon, 13 Jun 2005, James Lentini wrote:



On Sun, 12 Jun 2005, Tom Duffy wrote:

On Sat, 2005-06-11 at 11:20 +0200, Christoph Hellwig wrote:
Currently every dapl object embedds dapl_common which has a pointer
to the dapl_ia.  Now fixing that mess up a little every dat object
can have a dat_ia pointer (without the utter _common braindamage)
and there's one additional dereference, while saving one pointer per
allocated object.

The compiler should be smart enough to not make the access any more
costly since they contain that struct and don't have a pointer to it,

I believe the "one additional dereference" Christoph was referring to occurs if we implement his proposal and define dat objects as follows:

struct dat_ia {
        struct dat_provider *provider;
        union dat_context context;
}

struct dat_foo {
        struct dat_ia *ia;
        union dat_context context;
}

but I do agree that the _common structure is not ideal and sorta ugly.

I like it on the basis that if gathers up the common structure members in one place, hence making maintenance of these fields easier in the future. Granted, there are only two of them, so losing it wouldn't be a big deal.


-tduffy

_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to