On Thu, Jan 11, 2018 at 6:00 PM, Gustavo Sverzut Barbieri
<barbi...@gmail.com> wrote:
> On Thu, Jan 11, 2018 at 5:56 AM, Jean-Philippe André <j...@videolan.org> 
> wrote:
> ...

[snip]

>>> WRONG/BUG usage:
>>>     o = efl_add(cls, parent, ...); // refcnt = 1, the PARENT's reference
>>>     efl_unref(o); // refcnt = 0, but parent held the reference
>>>
>>
>> so this should ERR like now?
>
> YES, but unref/ref will be demoted, not handled like it's done now.
>
> basically now we all handle efl_unref() at some point, as Andrew said
> it's confusing when you need to do or not.
>
> to "spot for bugs" it will be possible to grep efl_ref/efl_unref ;-)
>
> to mitigate those, my recommendation is to generate new eoid in
> efl_ref() and invalidate it on the efl_unref()... like if they were 2
> different handles, but they point to the same underlying object.
> prevents too-much-unref, since the handle will be invalid.
>
> we can have the compiler to help by using proper function attributes,
> like done for malloc/free, warning unused results, etc.

This is an interesting idea. I wonder how expensive this is.
And if we could have a reference that "lives until next loop run"?

Regards,

[snip]

>
> --
> Gustavo Sverzut Barbieri
> --------------------------------------
> Mobile: +55 (16) 99354-9890
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel



-- 
Felipe Magno de Almeida

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to