D 2015/2016 Vision?

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 12 02:12:39 PDT 2015


On Monday, 12 October 2015 at 08:59:55 UTC, deadalnix wrote:
> Well technically, there is still ownership: the GC owns 
> everything. But yeah, you don't need to care about for this 
> very reason.

Only if you have finalizers. Without finalization it is better to 
think of the GC as a memory optimization that is transparent to 
the semantics of the program. It basically recycles identities 
(addresses) allowing us to "pretend" that they are unique by 
checking all relevant used identities (pointers). In some 
distributed contexts recycling identities is not worth the 
trouble... so you just use a big space (e.g. 64 bits)...

But in most settings you get practically the same result with a 
region allocator at the entry point of an event loop as with a 
GC. It uses more memory than explicit management, but so does GC.

The GC is usually more robust, but a GC can tank too if we forget 
to null out pointers (by running out of memory...).

Tradeoffs across the board.


More information about the Digitalmars-d mailing list