Tasks, actors and garbage collection

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Tue Apr 27 19:34:40 UTC 2021


On Tuesday, 27 April 2021 at 14:59:22 UTC, russhy wrote:
> i am asking we should aim to be a memory agnostic language, 
> where one can plugin a GC transparently and do what ever he 
> wants, and at the same time transition to a full manually 
> managed scheme with allocators transparently

That would be nice, wouldn't it? But there is no such design on 
the table for D. You have to write your framework differently in 
order to support reference counting and garbage collection if it 
does something non-trivial.

You have to write frameworks differently for RAII and 
non-deterministic destruction...

So in practice you have to settle on one main memory management 
scheme, and let other management schemes be optional. Library 
authors are not going to do a good job of testing their libraries 
for multiple memory management scheme, even if they thought they 
wrote the code to support both.

Sure the standard library can default to reference counting, but 
3rd party libraries probably won't.

This has nothing to do with moving to task-local GC or not, tough.


More information about the Digitalmars-d mailing list