Re: (inout) (transfer full) annotations for container types



On Thu, Feb 19, 2015, at 05:32 AM, Philip Withnall 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).

Introspection dates to before pervasive use of container free functions.

Basically yes, people should be using (transfer container) as much
as possible today.  

If (transfer full) is specified, it definitely means the caller is responsible
for freeing each element.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]