On Sat, Mar 03, 2001 at 02:52:40PM +0100, Marcus Brinkmann wrote:
> On Tue, Feb 27, 2001 at 04:11:31PM +0100, Neal H Walfield wrote:
> > This patch allows users of the ihash library to include the ihash
> > structure directly in user structures, i.e.:
> >
> > struct foo
> > {
> > struct ihash;
> > };
> >
> > Whereas before, this was not possible.
>
> Well, you could store an ihash_t in the struct, which is a pointer.
> Why would you want to store the struct and use init/destroy? You need the
> address anyway when invocing the functions operating on it.
We do exactly what I am suggesting with mutexes, thus, we have better cache
locality, e.g.:
struct foo
{
...
struct ihash hash;
...
};
Now, the ihash lives in the structure rather than in some other page in
memory. Then, when we need call a function, we do:
ihash_foo (&foo->hash, ...);
> Are you taking advantage of this in some code?
Not yet.
PGP signature