On Tue, May 14, 2002 at 02:05:25PM -0400, Melvin Smith wrote:
> 
> I would love to, except while I was browsing through the KEY* operations
> trying to understand what was actually being done, a big snarly,
> slobbering,
> comment eating beast rushed out from behind some lines of code and
> chased me for about a 1/2 a mile.

:-) Been there. It turns out that if you wrap a brick around your head
-- no, there's no trick to it, but the pain'll go away after a few
days -- the comment eating beast is so dumb that it thinks that if you
can't see it, then you're probably in enough pain already and it'll go
bother somebody else. Or something like that.

The key to understanding the KEY stuff is to realize that it was
originally intended for two totally different purposes: hashtable
buckets and aggregate keys. I doubt it ever correctly supported both
at the same time, even though both compiled. At least, that's the only
conclusion I could draw, though that could be the little brick
fragments talking from where they're embedded in my skull.

I posted a patch a while back to convert the aggregate keys to linked
lists, and create new data structures for hashtables. It's still
available off of http://foxglove.dnsalias.org/~sfink/hash-patch.txt.
I'm still working on the hash part (it doesn't play well with the
memory management stuff). But the KEY structure modification could be
pulled out quite easily -- in fact, the patch is ordered so that if
you threw out everything from t/pmc/perlhash.t on, you wouldn't get
any of the hash stuff. You'd still have to modify perlhash.pmc to get
it to compile, but that's easy.

I can't promise when I'll be able to finish my hash implementation, so
feel free to go ahead and implement your own. Mine is done in a
somewhat quirky way anyway. The basic holdup is that I'm too afraid of
bricks to do what's necessary to figure out what's really going on in
the memory subsystem.

Reply via email to