How to create nogc code?

Adam Sansier via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jul 10 18:16:11 PDT 2016


On Monday, 11 July 2016 at 01:08:16 UTC, Jonathan M Davis wrote:
> On Monday, July 11, 2016 00:37:39 Adam Sansier via 
> Digitalmars-d-learn wrote:
>> [...]
>
> When manually managing memory, you're dealing with basically 
> the same constructs that you would have in C/C++. I mean, 
> you're even using the exact same functions when you're dealing 
> with malloc and free. So, ultimately, something is going to 
> have to free each of those nodes individually, just like it 
> would in C/C++, but it could be managed by destructors if RAII 
> or reference counting is being used, just like you would in C++.
>
> [...]

Thanks. I'd rather prematurely optimize out the gc then have to 
go back and get it to work. It's not hard to write non-gc code, 
it's been done for ages.  But having some compiler help makes 
things nice. It seems there is more of a phobia of writing non-gc 
code than the phobia of the gc.




More information about the Digitalmars-d-learn mailing list