iPhone vs Android
Rikki Cattermole via Digitalmars-d
digitalmars-d at puremagic.com
Mon Sep 12 16:28:34 PDT 2016
On Monday, 12 September 2016 at 23:21:12 UTC, deadalnix wrote:
> RC itself is not panacea, it doesn't work well with exceptions,
> generate a huge amount of code bloat, hurt throughput, which
> you don't care in UI thread, but do care in the backend, and so
> on. But first and foremost, it is a disaster for shared data.
>
> I stay convinced that an hybrid approach is inevitable and am
> surprised why few are going there (hello PHP, here is a thing
> you get right).
I quite agree with the hybrid approach.
My rule of thumb is if it is short lived its "managed" but if it
can last a long time use the GC.
Ok so my managed memory concept auto deallocates as any ref
counting solution should do. So for short lived memory, this is
perfect since it isn't being moved around much and you can afford
it.
But for long lived references such as a window you really want
the default to be that you specifically tell it to deallocate at
a set point in time you know it should.
For reference, SPEW's UI creation manager[0] and screenshot
feature[1].
[0]
https://github.com/Devisualization/spew/blob/master/src/base/cf/spew/instance.d#L72
[1]
https://github.com/Devisualization/spew/blob/master/src/base/cf/spew/ui/window/features/screenshot.d#L26
More information about the Digitalmars-d
mailing list