This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: #import (Re: [PATCH] Fix -save-temps...)
On Sun, Nov 04, 2001 at 08:16:28PM -0800, Stan Shebs wrote:
> Zack Weinberg wrote:
> >
> > The argument against #import is that it cannot be made robust against
> > path aliasing or symbolic links, without suffering a performance hit.
> > cppfiles.c goes to considerable length to avoid system calls which may
> > do namei() operations, since these have historically been slow. For
> > instance, the multiple-include optimization ideally doesn't even open
> > the file a second time.
>
> Sniff sniff, I smell a carrot with which to get people to change
> their code...
I'll be happy to put this into the documentation if it will help. (I
wrote the relevant manual section before I knew there were technical
reasons for deprecating #import and #pragma once. As it stands, it
sounds like the only objection is their not being blessed by the
standard.)
> Very astute, that's basically what I do. It's not that great for
> efficiency, because I have to scan the whole splay tree after opening
> an #import file, but at least it's all in-memory ops.
The splay tree tends to show up in the lower half of the top 20 in
profiles. I therefore mean to change it to something else, but it
hasn't been high priority. But if we could, at the same time, get
you a better data structure for your patch, I could justify spending
my copious free time on it. What would work?
zw