mozilla/rust — pull request #9212 by blake2-ppc (2013-09-15 19:27:37+00:00)
Title: std::hashmap: Tighter representation for the Bucket

Replace `Option>` with a custom
`enum Bucket { Unused, Filled(hash, key, value) }`. The non-nullable
pointer optimization for enums with two variants will be active with the
new representation, while it was not with the old. This is if either
K or V is a non-nullable pointer type.

With these changes, now `Bucket` is 32 bytes and
`Bucket<~str,int>` is 24 bytes on 64-bit, so we save the 8 bytes of enum
tag per bucket.