[Top][All Lists]

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

Re: canonicalize_file_name should support win32 shortcuts

From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: Re: canonicalize_file_name should support win32 shortcuts
Date: Wed, 24 Aug 2011 00:43:37 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110820 Iceowl/1.0b2 Icedove/3.1.12

On 24.08.2011 00:17, Bruno Haible wrote:
> Hi Vladimir,
>>> hash.c in order to properly detect ELOOP, which must be done as part
>>> of an unlimited-depth link following algorithm.  (If we didn't have
>>> the GNU mantra of no arbitrary limits, then we could declare ELOOP at
>>> SYMLOOP_MAX instead.)
>> Brent's algorithm is universal, sets no arbitrary limit and requires no
>> hash and is implemented in few lines at a slight cost of going through
>> the cycle potentially up to 2 (or was it 3?) times.
>> http://en.wikipedia.org/wiki/Cycle_detection#Brent.27s_algorithm
> Interesting idea.
> But in file system related code like here, we consider a system call to be 
> very
> expensive (as it implies a context switch to the kernel and back). Whereas
> adding one entry to a hash table is rather quick on average. Therefore we
> try to minimize the number of system calls, even if it causes an increase in
> temporary memory use.
There is increase in number of calls only in the case of symlink loop
which isn't normal operation condition. Wehereas code simplicity and
memory usage benefits occur in normal conditions.
But your argumentation makes sense as well. In such cases it's mostly
maintainer's personal preference which matters.
> Bruno

Vladimir 'φ-coder/phcoder' Serbinenko

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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