On heap segregation, GC optimization and @nogc relaxing

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Thu Nov 13 17:04:45 PST 2014


On 11/11/2014 6:34 PM, deadalnix wrote:
> On an implementation level, a call to a pure function that return an owned could
> look like this :
>
> {
>    IslandID __saved = gc_switch_new_island();
>    scope(exit) gc_restore_island(__saved);
>
>    call_pure_function();
> }
>
> This allow us to rely much less on the GC and allow for a better GC implementation.

If that wrapper is automatically generated by the compiler, so the user doesn't 
have to mess with it, it could be workable.



More information about the Digitalmars-d mailing list