Re: [MERGE] RFC-compliant object invalidation behaviour.

From: Kinkie <gkinkie_at_gmail.com>
Date: Fri, 29 Aug 2008 00:10:12 +0200

On Thu, Aug 28, 2008 at 10:09 PM, Henrik Nordstrom
<henrik_at_henriknordstrom.net> wrote:
> On tor, 2008-08-28 at 23:26 +1200, Amos Jeffries wrote:
>
>> > +const char *
>> > +urlAbsolute(const HttpRequest * req, const char *relUrl)
>> > +{
>> > + LOCAL_ARRAY(char, portbuf, 32);
>> > + LOCAL_ARRAY(char, urlbuf, MAX_URL);
>>
>> LOCAL_ARRAY is unfortunately not thread safe. Someone else may argue,
>> but I prefer to see them dead.
>
> I have always wanted to see them dead for many reasons.
>
> * On reasonable systems (i.e. most non-dos) the stack is a very suitable
> place for temporary allocations.
>
> * Using a static local array as return value will bite you from time to
> time even without threading, and is absolutely not thread safe..

Ironic.. this was exactly the reason why I started coding String-ng
(now temporarily renamed KBuf).

-- 
 /kinkie
Received on Thu Aug 28 2008 - 22:10:15 MDT

This archive was generated by hypermail 2.2.0 : Fri Aug 29 2008 - 12:00:06 MDT