This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/5] remove deleted BFDs from the archive cache


>>>>> "HJ" == H J Lu <hjl.tools@gmail.com> writes:

HJ> +      else
HJ> +	{
HJ> +	  /* If HTAB is NULL, free ARED allocated with bfd_zmalloc.  */
HJ> +	  free (ared);
HJ> +	}

HJ> However, it assumes that archive member from filesystem is
HJ> closed after archive.  It won't be easy to get around it since
HJ> we can't get from archive member from filesystem to
HJ> archive.

I prefer my approach, because although my patch is more complicated, the
resulting code is simpler.  I think this because, after my patch, an
areltdata is allocated in a single way and also freed in a single way.
This uniformity makes them easier to reason about.

I find the above quite obscure.  It assumes an invariant that is not
obvious and that is also not documented.

If you go with your patch, I'd recommend you also fix the latent bugs I
pointed out.  Some of them would require different fixes than what I
posted.

Tom


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