[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs & MAXPATHLEN

From: Giuseppe Scrivano
Subject: Re: emacs & MAXPATHLEN
Date: Sun, 31 Jul 2005 02:05:30 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> Someone wrote:
>     In my opinion it is better to alloc directly MAXPATHLEN+1 bytes
>     when that limit exists without entering the loop and use multiple
>     reallocations.
> It's best to keep the code simple, all else being equal,
> and reduce the number of conditionals.

To keep the code simple we can remove the #ifdef MAXPATHLEN...#endif piece in 
the HAVE_GETCWD part.  In this way we use always the loop both if MAXPATHLEN is 
defined or not.  
Anyway, checking for the MAXPATHLEN inside the loop doesn't change the number 
of switches, if we want to check for the limit I suggest to have the check 
outside the loop and avoid multiple reallocations.

Giuseppe Scrivano

reply via email to

[Prev in Thread] Current Thread [Next in Thread]