Smart pointers instead of GC?

Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang at gmail.com> Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang at gmail.com>
Tue Feb 4 01:12:37 PST 2014


On Tuesday, 4 February 2014 at 07:06:07 UTC, Eric Suen wrote:
> As long as other code is in managed code, there is GC running at
>  background, no matter your code write in whatever high 
> performance
> language, it will be affect by GC anyway.  so that "So, 
> Microsoft does
> not think that GC is suitable for real time > interactive 
> graphics.
> And they are right." is only your opinion. you don't know the 
> real reason
> behind MS's decision. some resource need release ASAP, so you 
> can't
> rely on GC. or maybe bacause of overhead when call low API in 
> managed
> code.

Anyone who has tried to use Direct 3D from managed code knows 
why. They had the foundation to do everything from manage code, 
but chose not to.

You can get smooth animations in GC javascript on browsers too, 
but only if relying on the C++ CSS transition engine which does 
the frame-by-frame interpolation for you. But I expect javascript 
to get better at this if/when using true isolates. If the memory 
pool is small enough GC can work out ok, but for very low 
latency/overhead you use the stack/pools, not even malloc is good 
enough then.





More information about the Digitalmars-d mailing list