Disable GC entirely

Manu turkeyman at gmail.com
Mon Apr 8 03:28:49 PDT 2013


On 8 April 2013 20:10, Dicebot <m.strashun at gmail.com> wrote:

> On Monday, 8 April 2013 at 09:41:05 UTC, Jacob Carlborg wrote:
>
>> On 2013-04-08 11:17, Dicebot wrote:
>>
>>  b) You are forced to make function templated to mark it as @nogc. Bad.
>>>
>>
>> It depends on how it's used. If it's enough to annotate a type the
>> function doesn't need to be templated. This should work just fine:
>>
>> class Foo { }
>>
>> struct ThreadSafe (T)
>> {
>>     T t;
>> }
>>
>> ThreadSafe!(Foo) foo;
>>
>> void process (ThreadSafe!(Foo) foo) { /* process foo */ }
>>
>
> Hm, so you propose to use something like Malloced!Data / Stack!Data
> instead of marking whole function with @nogc? Interesting, I have never
> though about this approach, may be worth trying as proof-of-concept.
>

It's such a dirty hack though ;) .. that does not give the impression, or
confidence that the language addresses the problem. Actually, quite the
opposite. If I saw that, I'd be worried...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130408/45663037/attachment-0001.html>


More information about the Digitalmars-d mailing list