cURL / Mailing Lists / curl-library / Single Mail

curl-library

re: Inconsistency in memory allocation

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 18 Sep 2002 17:01:04 +0200 (MET DST)

On Wed, 18 Sep 2002, Peter Verhas wrote:

(moved this thread over to the libcurl list)

> In the ScriptBasic project the modules have to be initialized including the
> definition of the memory allocation and releasing function. This way the
> modules will get memory from where the caller wants and it is upon the
> caller how to release the memory.
>
> CURL could do the same.

libcurl uses malloc() to allocate memory and simply requires free() to free
it again. That is how C works. That is defined in standards written decades
ago.

That is not inconsistent.

The fact that Windows, or at least MSVC++, commits very ugly deeds and
redefines what malloc() and free() do, depending on which compiler flags you
use, doesn't make libcurl inconsistent.

I hate being forced to do (even more) ugly things in libcurl just because one
particular OS, or even one particular compiler provider, does stupid tricks.

Why can't the MSVC-users just make sure that they use a DLL that has the same
"Release" or "Debug" state as the application you're working on? I'm trying
to understand this.

-- 
 Daniel Stenberg -- curl related mails on curl related mailing lists please
-------------------------------------------------------
This SF.NET email is sponsored by: AMD - Your access to the experts
on Hammer Technology! Open Source & Linux Developers, register now
for the AMD Developer Symposium. Code: EX8664
http://www.developwithamd.com/developerlab
Received on 2002-09-18