News for hackers. Stuff that matters.
Re:Storing hundreds of millions of simple key-value pairs in... by qeorge on Tuesday November 01, 2011 @08:20PM (#3184785)
Gotcha. I'm not an OS guy, and didn't know that convention. Thanks!

Dumb question though:

If rehash can only return -1 or 0, won't

   if(rehash(H))
always fail?
Re:Storing hundreds of millions of simple key-value pairs in... by cperciva on Tuesday November 01, 2011 @09:16PM (#3184931)
Dumb question though...

There's no such thing as a dumb question, only people too dumb to take every available opportunity to learn. ;-)

In C, "if (foo)" means "if (foo != 0)" if foo has integer type, so that line means "if (rehash(H) != 0)" or (since rehash only returns 0 or -1) equivalently "if (rehash(H) == -1)".

Re:Storing hundreds of millions of simple key-value pairs in... by qeorge on Tuesday November 01, 2011 @09:20PM (#3184941)
Thanks so much Colin, I'm learning a lot today. :)
Re:Storing hundreds of millions of simple key-value pairs in... by ralph on Wednesday November 02, 2011 @09:27PM (#3189756)
The reason for the convention is that there's often only one form of success, so 0 suffices, but there may be many causes of failure.