[Dlang-study] [lifetime] Initial thoughts on lifetime management

Dmitry Olshansky dmitry.olsh at gmail.com
Wed Oct 28 02:05:35 PDT 2015


On 28-Oct-2015 12:03, Walter Bright wrote:
>
>
> On 10/28/2015 1:40 AM, Dmitry Olshansky wrote:
>>
>> Just a short note on this: COM (which is the backbone of all new 
>> WinRT) would be nice to support as well and that means being flexible 
>> with where and how reference count is stored. Even putting aside COM 
>> & ObjectiveC - in some cases storing ref-counts in a separate block 
>> is advantageous and limiting ourselves to hidden embedded ref-count 
>> is not necessary.
>
> D already supports COM - just derive from IUnknown.
>
> I don't think it'll be a good idea to base a native rc mechanism on 
> COM, though. 
Nor do I see below.
> COM relies on virtual functions to do the ref counting (slow), and of 
> course it would interfere with any code that called AddRef or Release 
> directly. I'm not sure how it would interact with the large body of 
> existing COM code.

I mean our @rc stuff should automatically work for ref-counting of COM 
objects and beyond. Manual ref-counting of COM is error prone, library 
solution is suboptimal see Andrei initial post.
> _______________________________________________
> Dlang-study mailing list
> Dlang-study at puremagic.com
> http://lists.puremagic.com/cgi-bin/mailman/listinfo/dlang-study


-- 
Dmitry Olshansky


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3707 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.puremagic.com/pipermail/dlang-study/attachments/20151028/12ff9ca7/attachment-0001.bin>


More information about the Dlang-study mailing list