Patch: cse "library" routines

Richard Henderson rth@cygnus.com
Fri Mar 10 16:01:00 GMT 2000


On Fri, Mar 10, 2000 at 08:40:09PM +0000, Bernd Schmidt wrote:
> This patch has already been reviewed by Joern Rennecke, but it still needs
> approval.  It passed a bootstrap on x86 yesterday.

It looks generally good.  Couple o questions --

> + /* A table that enables us to look up elts by their value.  */
> + #define NBUCKETS 32
> + #define VALUE_HASH(V) ((V) % NBUCKETS)
> + 
> + static cselib_val *table[NBUCKETS];

Why your own hash table implementation rather than one of the
couple of dictionary-type widgets we already have in libiberty?

> + static struct elt_list *
> + new_elt_list (next, elt)
[...]
> +     el = (struct elt_list *) xmalloc (sizeof (struct elt_list));
[...]
> + new_elt_loc_list (next, loc)
[...]
> +     el = (struct elt_loc_list *) xmalloc (sizeof (struct elt_loc_list));

I don't see a free to go along with these mallocs.  Perhaps
you meant to do it in clear_table?


r~


More information about the Gcc-patches mailing list