C++ and D @ stackoverflow

Brad Roberts braddr at puremagic.com
Sat Jun 12 13:57:47 PDT 2010


On 6/12/2010 1:53 PM, Walter Bright wrote:
> Brad Roberts wrote:
>> Or, even better:
>>
>> import core.memory;
>>
>> void* m = GC.malloc(size);
> 
> The idea was to not use the gc, instead explicitly manage the block of
> memory.

Actually, the point was to get precise lifetime of memory, right?  That's where
the refcounting comes in.  That the memory comes from the gc doesn't mean it
can't be refcounted to achieve that.  It does mean that it's needlessly scanned
as part of any collection cycles.  It's not too hard to suggest that it's worth
doing to find refcount cycles that should have gone away.



More information about the Digitalmars-d mailing list