cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Modifying the example source code

From: Tor Arntsen <tor_at_spacetec.no>
Date: Tue, 1 Mar 2011 17:06:50 +0100

On Mon, Feb 28, 2011 at 23:13, Ben Noordhuis <info_at_bnoordhuis.nl> wrote:
> On Mon, Feb 28, 2011 at 09:34, Tor Arntsen <tor_at_spacetec.no> wrote:
>> Just to pre-answer a question people may ask.. realloc(NULL) works
>> fine on many architectures. But not on all architectures. To be
>> perfectly portable we use the malloc(1) trick.
>
> Tor, do you happen to know on what platforms or architectures
> realloc(NULL) causes issues? ISO mandates that it should be
> functionally equivalent to malloc() and I use it like that in my own
> code. It's never blown up so far but if there are portability issues,
> I'd like to be one step ahead of them.

AIX 4.x comes to mind. Note that it doesn't crash all the time.. only sometimes.

-Tor
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-03-01