Is libiberty's splay-tree.c really a splay tree?

Richard Sandiford richard.sandiford@linaro.org
Tue Jul 5 13:10:00 GMT 2011


Michael Matz <matz@suse.de> writes:
> On Tue, 5 Jul 2011, Richard Sandiford wrote:
>> FWIW, the reason I asked was because I'm using a splay tree in a patch
>> that I hope to send soon.  The libiberty structures are a bit heavyweight,
>> with the hooks stored alongside the root pointer, and with each node
>> being a separate structure from the key and value.  Since all I needed
>> was a find-or-insert operation,
>
> find-and-insert only?  Then a hashtable most probably is better anyway.

Maybe.  I was interested in using a splay tree because the pass tends
to reference the most recently-added elements (the last handful rather
than the last one).

Richard



More information about the Gcc mailing list