Disable GC entirely

Jacob Carlborg doob at me.com
Mon Apr 8 02:13:01 PDT 2013


On 2013-04-08 09:46, eles wrote:

> That kind of genericity will be just wonderful in some cases. For
> example, one could make sure, at compilation, that interrupt code does
> not call sleeping code when it comes to Linux kernel programming.
>
> I wonder, however, if one could re-define the notions of green/red
> several times in a project. Maybe per-module basis?

Of course. If I recall correctly you just annotate a type or similar:

struct ThreadSafe (T)
{
     T t;
}

void bar (ThreadSafe!(Foo) foo) { )

Now "bar" will only accept a thread safe "Foo".

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list