(gcc returns mem) Re: When is it time for a 1.0 feature freeze?

Sean Kelly sean at f4.ca
Fri Sep 22 15:25:49 PDT 2006


Bruno Medeiros wrote:
> Sean Kelly wrote:
>> Bruno Medeiros wrote:
>>>
>>> Walter had mentioned before that DMD's memory manager use C's malloc 
>>> and free to allocate, so no difference in return behavior is to be 
>>> expected.
>>
>> It actually uses VirtualAlloc, though malloc is a failover option in 
>> GDC's memory manager.
> 
> Hum, didn't Walter once mention that nearly all compiler implementations 
> of new and delete used malloc? I assumed his compilers where one of such 
> (didn't look at Phobos). Perhaps that simply was not the case. Or 
> perhaps he just meant C++ compilers?

He meant C++ compilers.  But the situation in D is somewhat different 
because of garbage collection.  malloc is itself a memory allocator and 
D's GC is also an allocator, so having D's allocator call malloc would 
be like one retail store buying all their products from another retail 
store in bulk--it's much more efficient just to order from the 
distributer :-)


Sean



More information about the Digitalmars-d mailing list