bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] libihash


From: Neal H Walfield
Subject: Re: [PATCH] libihash
Date: Wed, 7 Mar 2001 15:26:40 +0100
User-agent: Mutt/1.3.12i

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.

Attachment: pgp4MKiUfITRd.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]