[PATCH 1/4] libibery/hashtab: add new functions

Tom Tromey tom@tromey.com
Mon Aug 17 14:33:07 GMT 2020


Martin> +void
Martin> +htab_insert (htab_t htab, PTR element)
Martin> +{
Martin> +  void **slot = htab_find_slot (htab, element, INSERT);
Martin> +  *slot = element;

If there is an old value, and if htab->del_f is non-NULL, then this
should call del_f function.  Otherwise, I think this leaks memory.

Tom


More information about the Binutils mailing list