Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Aug 2008 12:16:39 +0200
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        Ivan Voras <ivoras@freebsd.org>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: Magic symlinks redux
Message-ID:  <20080822101639.GA58256@onelab2.iet.unipi.it>
In-Reply-To: <g8m2lb$r78$1@ger.gmane.org>
References:  <g8kv7v$sp2$1@ger.gmane.org> <20080822090448.GB57441@onelab2.iet.unipi.it> <g8m2lb$r78$1@ger.gmane.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Aug 22, 2008 at 11:59:07AM +0200, Ivan Voras wrote:
...
> >+ efficiency of symlink_magic() might be improved too:
> >  e.g. the function could do a quick check for the presence of @ and return
> >  without allocation/deallocation if not found;
> 
> I think it's because the author wanted a single pass over the string (in 
> case of the "extended" @{...} syntax we can't just check if cp[0] == 
> '@'). The first few lines of the symlink_magic loop ("if (cp[i] != 
> '@')") effectively do what strchr() does.

right, but doing the check upfront might save the uma_zalloc/zfree call
in the common case.

	cheers
	luigi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080822101639.GA58256>