cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Modifying the example source code

From: Ben Noordhuis <info_at_bnoordhuis.nl>
Date: Mon, 28 Feb 2011 23:13:57 +0100

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.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-02-28