This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch: cse "library" routines


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~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]