Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Hugh number of file descriptor checks



On Sun, 21 Feb 2010 09:11:52 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> Sorry to be a bit late responding to this, I was traveling ...
> 
> On Feb 19, 10:45am, Peter Stephenson wrote:
> } 
> } How about the following?  I also tried to tidy up the rellocation of
> } fdtable a bit.
> } 
> }  /**/
> }  mod_export long
> }  zopenmax(void)
> }  {
> } -    static long openmax = 0;
> } +    long openmax = 0;
> }  
> }      if (openmax < 1) {
> 
> Did you really mean to remove "static" there?

Yes.

>  With that removed, the
> "if (openmax < 1)" will ALWAYS be true, so there's no point in testing
> it 

You're right, that can go.

> -- but the intention of having openmax be static was so that once
> it's determined, we know what it is and never probe it again.
> 
> That is, on certain platforms I think you've traded startup-time
> inefficiency for later run-time inefficiency.

It should now only ever be called at initialisation, since I've removed
the only other call to it (unless you can see otherwise).

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



Messages sorted by: Reverse Date, Date, Thread, Author