GNOME Bugzilla – Bug 639081
gi-scanner: caller-allocates inference does not work for records ref'd by alias
Last modified: 2015-02-07 16:50:47 UTC
Typically seen on GdkRectangle, which is actually typedef to cairo_rectangle_int_t. Having API: /** * foo: * @area: (out): */ void foo (GdkRectangle *area); yields .gir with 'area' argument marked as caller-allocates="0".
Created attachment 177877 [details] [review] Resolve aliases when detecting records/unions.
Review of attachment 177877 [details] [review]: ::: giscanner/maintransformer.py @@ +506,3 @@ + and target.target.target_giname is not None): + target = self._transformer.lookup_giname( + target.target.target_giname) This should go in a helper method somewhere; something on transformer?
Created attachment 177961 [details] [review] Follow aliases to records when calculating caller-allocates attribute value Thanks for review. Here's hopefully better patch, removes obsolete unused transformer.follow_aliases() and adds transformer.resolve_aliases() which works on typenodes instead of gi_names. The rest of patch just uses this new method.
Review of attachment 177961 [details] [review]: Looks fine. ::: tests/scanner/regress.c @@ +2897,3 @@ +void regress_aliased_caller_alloc (RegressAliasedTestBoxed *boxed) +{ + boxed->priv = g_slice_new0(RegressTestBoxedPrivate); Space between identifier and paren. ::: tests/scanner/regress.h @@ +583,3 @@ + * RegressAliasedTestBoxed: + * + * Typedef'd TestBoxed for some reasons. I know other comments have "for some reason", but can you explicitly write here: "Typedef TestBoxed to test caller-allocates correctness"
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]