This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC]: Greatly speed symbol lookups
jtc@redback.com (J.T. Conklin) writes:
> >>>>> "dan" == Daniel Berlin <dan@cgsoftware.com> writes:
> Just a nit, but why the change from xfree() to free()? In the recent
> past, we've been changing the remaining calls to free() to xfree().
Complete accident, actually.
I would have taken them out of the patch, except I couldn't remember
which way we were going (IE free->xfree or xfree->free).
>
> If this code was to change, I'd think that we'd take advantage of the
> behavior of xfree() and do something like:
>
> xfree (subfile->name);
> xfree (subfile->dirname);
> xfree (subfile->line_vector);
> xfree (subfile->debugformat);
>
> nextsub = subfile->next;
> xfree (subfile);
>
> dan> *** 995,1017 ****
> dan> }
> dan> if (subfile->name != NULL)
> dan> {
> dan> ! xfree ((void *) subfile->name);
> dan> }
> dan> if (subfile->dirname != NULL)
> dan> {
> dan> ! xfree ((void *) subfile->dirname);
> dan> }
> dan> if (subfile->line_vector != NULL)
> dan> {
> dan> ! xfree ((void *) subfile->line_vector);
> dan> }
> dan> if (subfile->debugformat != NULL)
> dan> {
> dan> ! xfree ((void *) subfile->debugformat);
> dan> }
> dan>
> dan> nextsub = subfile->next;
> dan> ! xfree ((void *) subfile);
> dan> }
> dan>
> dan> /* Set this for the main source file. */
> dan> --- 991,1013 ----
> dan> }
> dan> if (subfile->name != NULL)
> dan> {
> dan> ! free ((void *) subfile->name);
> dan> }
> dan> if (subfile->dirname != NULL)
> dan> {
> dan> ! free ((void *) subfile->dirname);
> dan> }
> dan> if (subfile->line_vector != NULL)
> dan> {
> dan> ! free ((void *) subfile->line_vector);
> dan> }
> dan> if (subfile->debugformat != NULL)
> dan> {
> dan> ! free ((void *) subfile->debugformat);
> dan> }
> dan>
> dan> nextsub = subfile->next;
> dan> ! free ((void *) subfile);
> dan> }
>
>
> --
> J.T. Conklin
> RedBack Networks
--
"I bought a dog the other day... I named him Stay. It's fun to
call him... "Come here, Stay! Come here, Stay!" He went
insane. Now he just ignores me and keeps typing. He's an East
German Shepherd.
"-Steven Wright