httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: cvs commit: apache-1.3/src/modules/standard mod_log_referer.c
Date Fri, 22 May 1998 18:54:05 GMT
Marc Slemko wrote:
> 
> On Thu, 21 May 1998, Ben Laurie wrote:
> 
> > brian@hyperreal.org wrote:
> > >   -        ap_str_tolower(referer);
> > >   +        referertest = ap_pstrdup(orig->pool, referer);
> > >   +        ap_str_tolower(referertest);
> >
> > Where these things are for local use only, wouldn't it be better (i.e.
> > more efficient) to use alloca?
> >
> >       referertest=alloca(strlen(referer)+1);
> >       strcpy(referertest,referer);
> >       ap_str_tolower(refertest);
> 
> I can't check my references since they are packed in a box across the room
> that I don't want to dig through them, but I wouldn't recommend alloca.
> It is too ugly for what it gains, and it adds a new type of memory
> management for little gain.

Hmmm ... interesting that they all warn that it is machine-dependent
(but so what? So is open()) but they still all have it :-)

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686|  Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |
A.L. Digital Ltd,     |Apache-SSL author    http://www.apache-ssl.org/
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache

Mime
View raw message