Source-Changes-D archive

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

Re: CVS commit: src



Mindaugas Rasiukevicius wrote:
> Simon Burge <simonb%NetBSD.org@localhost> wrote:
> > > > > Are you referring to the weakness when using 4-bytes?
> > > > > Anyway, that is why the file name does not have 2 in it, so that we
> > > > > could add MurmurHash3 as well.
> > > > 
> > > > That's completely different to the other hashes we have in the source
> > > > tree.  Can you rename the file so that it's consistent please?
> > > 
> > > Because other hashes use very different interface, with a context and
> > > common template in libc (rather horrible macros).  There is no need to
> > > create a directory for every different version of MurmurHash.  Rather
> > > undesirable, I would say.
> > 
> > I wasn't talking about creating a directory for every variant of murmur,
> > just putting each variant in a separate .c file.  Eg:
> > 
> >     src/common/lib/libc/hash/murmurhash/murmurhash2.c
> >     src/common/lib/libc/hash/murmurhash/murmurhash3.c
> > 
> > Or do you intend on adding other variants of murmur to the current .c
> > file if/when needed?
> 
> Yes, I would like to add MurmurHash3 to the same module.  Having them in
> the same module enables easier code reuse, when it's the case.  Do you
> see a good reason to have them in separate modules?

There's practically no code to reuse between the two hashes.  It's also
worth noting that the reference implementation keeps the code for the
two (three including the original murmurhash1) in separate source files.

Cheers,
Simon.


Home | Main Index | Thread Index | Old Index