bug-gnulib
[Top][All Lists]
Advanced

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

Re: canonicalize_file_name should support win32 shortcuts


From: Bruno Haible
Subject: Re: canonicalize_file_name should support win32 shortcuts
Date: Wed, 24 Aug 2011 00:17:18 +0200 (MEST)

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.

Bruno




reply via email to

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