DMD + nedmalloc?

davidl davidl at nospam.org
Thu Jun 4 21:05:38 PDT 2009


在 Fri, 05 Jun 2009 11:18:43 +0800,davidl <davidl at nospam.org> 写道:

> 在 Fri, 05 Jun 2009 10:51:51 +0800,davidl <davidl at nospam.org> 写道:
>
>> 在 Fri, 05 Jun 2009 08:51:25 +0800,Jarrett Billingsley
>> <jarrett.billingsley at gmail.com> 写道:
>>
>>> On Thu, Jun 4, 2009 at 8:50 PM, Jarrett Billingsley
>>> <jarrett.billingsley at gmail.com> wrote:
>>>
>>>>
>>>> http://www.digitalmars.com/d/archives/digitalmars/D/nedmalloc_47148.html
>>>> http://lists.puremagic.com/pipermail/digitalmars-d/2007-January/013224.html
>>>
>>> Oops, meant to post this link instead:
>>>
>>> http://www.digitalmars.com/d/archives/digitalmars/D/Compiling_nedmalloc_w_DMC_46240.html
>>
>> attachment 2
>>
>
> Or, rather than dmc's codegen bug, I think I might trigger the nasty C  
> "bug" actually. C can call a function without any prior declaration of  
> it, and compiler needs to accept that, and create corresponding mangled  
> name.
> The issue is probably the winbase.h is not up to date.
>

Err, no, there should still be some bug in dmc. I tried to modify the  
calling to (long*)-1, dmc complains it can't implicitly cast from long* to  
long.

To test this, get the nedmalloc source and change as following:

malloc.c.h
         interlockedcompareexchange(&malloc_global_mutex_status, -1, 0) ==  
0) {
changed to :
         interlockedcompareexchange(&malloc_global_mutex_status, (long*)-1,  
0) == 0) {
	
DMC would complain after this change. So we know that DMC knows the  
prototype of that func.

I'm confused. :(

-- 
使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/



More information about the Digitalmars-d mailing list