Re: [PATCH 0/6] Misc fixes and improved annotations



On 09/07/2010 10:44 AM, Simón Pena Placer wrote:
> On 7 September 2010 09:30, Iago Toral <itoral igalia com> wrote:
>   
>> On Mon,  6 Sep 2010 19:04:10 +0200, Simón Pena <spenap gmail com>
>> wrote:
>>     
>>> Regarding to that, I'd like to ask you to check the functions dealing
>>> with GLists in the
>>> GrlMetadataSource: I've annotated them with (transfer none),
>>> (transfer container)
>>> and (transfer full) depending on who owns those lists after calling
>>> the functions,
>>> by looking at the code and existing documentation. However, I could be wrong.
>>>       
>> I was checking this and I wonder about those "transfer full" for some
>> functions returning GLists of keys (example:
>> grl_metadata_source_filter_supported). If I understand correctly,
>> "transfer full" means that the client should free both the container and
>> the content, right? But it is my understanding that we should never free
>> the actual keys (for they are static pointers)... or am I missing
>> something?
>>     
> You're completely right: those are incorrectly annotated, as the
> actual keys should never be freed. Thanks, I'll correct that in the
> afternoon :)
>
>   

Hi,

Please note that "(transfer full)" is a default annotation. In most
cases, g-ir-scanner will guess the correct values using the predefined
annotations [1]. There is no need to annotate everything, but *only*
these symbols for which the default, guessed annotations are incorrect
or ambiguous.

If we annotate all symbols including those which can be guessed
correctly, we will have tons of annotation code to maintain. We really
don't want that.

In this specific case you describe, (transfer-none) never have to be
annotated for it is the default.

my two cents,
Edu

[1] http://live.gnome.org/GObjectIntrospection/Annotations

Attachment: signature.asc
Description: OpenPGP digital signature



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