Re: (inout) (transfer full) annotations for container types
- From: Simon Feltman <s feltman gmail com>
- To: Philip Withnall <philip tecnocode co uk>
- Cc: gir-devel-list gnome org, Sergio Mariotti <sergio mariotti it gmail com>
- Subject: Re: (inout) (transfer full) annotations for container types
- Date: Sat, 28 Feb 2015 23:52:54 -0800
On Thu, Feb 19, 2015 at 2:32 AM, Philip Withnall <philip tecnocode co uk> wrote:
If there is no convention, I suggest it makes more sense to have the
caller only ever call g_array_unref(), g_ptr_array_unref(),
g_hash_table_unref(), and never explicitly free the elements. For
(transfer full), the callee should be responsible for setting the
clear/free function for elements. For (transfer container), the callee
should be responsible for *not* setting such a function (or for adding
the elements to a newly allocated container with no free function set,
or similar).
For what it's worth, this interpretation makes a lot of sense to me.
-Simon
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]