bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: malloc.m4 should treat mingw like posix


From: Bruno Haible
Subject: Re: malloc.m4 should treat mingw like posix
Date: Fri, 16 Nov 2007 00:53:08 +0100
User-agent: KMail/1.5.4

Eric Blake wrote:
> my understanding (although it 
> may be limited, since I don't follow mingw development) is that mingw defers 
> to 
> the Microsoft malloc

Yes, it does (except if the executable is run emulated in 'wine').

> Do you have a pointer into the MSDN pages or the mingw source code that can 
> back up your claim, before we consider applying this patch?

Looking at the msvcrt code from 2001, I can see that:
  - malloc(0) is treated like malloc(small_positive_amount) in all codepaths
    (they have 4 different malloc implementations under the hood!),
  - when malloc returns NULL, it does *not* set errno.

Therefore the malloc-posix module must replace 'malloc', and since the
'malloc' module depends on 'malloc-posix', this module must replace 'malloc' as
well.

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]