D on quora ...

Atila Neves atila.neves at gmail.com
Mon Oct 16 13:49:50 UTC 2017


On Monday, 16 October 2017 at 09:58:46 UTC, Ecstatic Coder wrote:
> On Sunday, 15 October 2017 at 20:42:36 UTC, Laeeth Isharc wrote:
>> On Sunday, 15 October 2017 at 07:21:55 UTC, Ecstatic Coder 
>> wrote:
>>> [...]
>>
>> Out of curiosity, what is it that stops you keeping the heap 
>> small and allocating memory manually for the rest?
>
> In D I've the added complexity in trying to use the game engine 
> (cocos2dx, unreal, cryengine) C++ libraries from D.
>
> So that's not worth the effort, if I can't use D's powerful 
> standard library as usual.
>
> I don't like the idea that any hidden object allocation or 
> string concatenation can trigger a GC for an undefined amount 
> of time.
>
> In C++ you also have plenty of objects constructors/destructors 
> called everywhere in your back, but none of them will ever 
> trigger a GC...

A std::shared_ptr going out of scope can pause the program for 
just as long as a GC mark-and-sweep.

Have you tried using a @nogc main loop in your programs/games? 
I'm curious to learn why that might not have worked for you.

Atila


More information about the Digitalmars-d mailing list