[gobject-introspection] Support (out caller-allocates)



commit 5589687a1fa5d4c7f15213ee3cd6860a03587ced
Author: Colin Walters <walters verbum org>
Date:   Wed Dec 16 11:47:19 2009 -0500

    Support (out caller-allocates)
    
    People have wanted support for marking (out) on functions of the
    form:
    
    /**
     * clutter_color_from_pixel:
     * @pixel: A pixel
     * @color: (out): Color to initialize with value of @pixel
     */
    void
    clutter_color_from_pixel (guint32 pixel, ClutterColor *color);
    
    Where the caller is supposed to have allocated the argument; the
    C function just initializes it.  This patch adds support for this
    argument passing style to introspection.  In this case, we see the
    (out), and notice that there's only a single indirection (*) on
    the argument, and assume that this means (out caller-allocates).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=604749

 gir/Everything-1.0-expected.gir            |  147 ++++++--
 gir/GIMarshallingTests-1.0-expected.gir    |  633 ++++++++++++++++++++++------
 gir/everything.c                           |    4 +-
 girepository/ginfo.c                       |   12 +-
 girepository/girepository.h                |    1 +
 girepository/girnode.c                     |    2 +-
 girepository/girnode.h                     |    2 +-
 girepository/girparser.c                   |   20 +-
 girepository/gtypelib.h                    |    6 +-
 giscanner/annotationparser.py              |   24 +-
 giscanner/ast.py                           |    1 +
 giscanner/girwriter.py                     |    2 +
 tests/invoke/testfns-1.0.gir               |    8 +-
 tests/scanner/annotation-1.0-expected.gir  |   18 +-
 tests/scanner/annotation-1.0-expected.tgir |   12 +-
 tests/scanner/drawable-1.0-expected.gir    |   20 +-
 tests/scanner/drawable-1.0-expected.tgir   |    8 +-
 tools/generate.c                           |    6 +-
 18 files changed, 731 insertions(+), 195 deletions(-)
---
diff --git a/gir/Everything-1.0-expected.gir b/gir/Everything-1.0-expected.gir
index bcd71b2..1deed26 100644
--- a/gir/Everything-1.0-expected.gir
+++ b/gir/Everything-1.0-expected.gir
@@ -270,16 +270,25 @@ and/or use gtk-doc annotations.  -->
           <parameter name="x" transfer-ownership="none">
             <type name="int" c:type="int"/>
           </parameter>
-          <parameter name="y" direction="out" transfer-ownership="full">
+          <parameter name="y"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="full">
             <type name="double" c:type="double*"/>
           </parameter>
-          <parameter name="z" direction="out" transfer-ownership="full">
+          <parameter name="z"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="full">
             <type name="int" c:type="int*"/>
           </parameter>
           <parameter name="foo" transfer-ownership="none">
             <type name="utf8" c:type="char*"/>
           </parameter>
-          <parameter name="q" direction="out" transfer-ownership="full">
+          <parameter name="q"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="full">
             <type name="int" c:type="int*"/>
           </parameter>
           <parameter name="m" transfer-ownership="none">
@@ -298,16 +307,25 @@ and/or use gtk-doc annotations.  -->
           <parameter name="x" transfer-ownership="none">
             <type name="int" c:type="int"/>
           </parameter>
-          <parameter name="y" direction="out" transfer-ownership="full">
+          <parameter name="y"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="full">
             <type name="double" c:type="double*"/>
           </parameter>
-          <parameter name="z" direction="out" transfer-ownership="full">
+          <parameter name="z"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="full">
             <type name="int" c:type="int*"/>
           </parameter>
           <parameter name="foo" transfer-ownership="none">
             <type name="utf8" c:type="char*"/>
           </parameter>
-          <parameter name="q" direction="out" transfer-ownership="full">
+          <parameter name="q"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="full">
             <type name="int" c:type="int*"/>
           </parameter>
           <parameter name="m" transfer-ownership="none">
@@ -475,7 +493,11 @@ case.">
           <type name="none" c:type="void"/>
         </return-value>
         <parameters>
-          <parameter name="a_out" transfer-ownership="none">
+          <parameter name="a_out"
+                     direction="out"
+                     caller-allocates="1"
+                     transfer-ownership="none"
+                     doc="the cloned structure">
             <type name="TestStructA" c:type="TestStructA*"/>
           </parameter>
         </parameters>
@@ -495,7 +517,11 @@ case.">
           <type name="none" c:type="void"/>
         </return-value>
         <parameters>
-          <parameter name="b_out" transfer-ownership="none">
+          <parameter name="b_out"
+                     direction="out"
+                     caller-allocates="1"
+                     transfer-ownership="none"
+                     doc="the cloned structure">
             <type name="TestStructB" c:type="TestStructB*"/>
           </parameter>
         </parameters>
@@ -629,6 +655,7 @@ case.">
       <parameters>
         <parameter name="ints"
                    direction="out"
+                   caller-allocates="0"
                    transfer-ownership="full"
                    doc="a list of 5 integers ranging from 0 to 4">
           <array c:type="int**" fixed-size="5">
@@ -729,7 +756,10 @@ case.">
         </array>
       </return-value>
       <parameters>
-        <parameter name="len" direction="out" transfer-ownership="full">
+        <parameter name="len"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="int*"/>
         </parameter>
       </parameters>
@@ -772,12 +802,14 @@ case.">
       <parameters>
         <parameter name="n_ints"
                    direction="inout"
+                   caller-allocates="0"
                    transfer-ownership="full"
                    doc="the length of @ints">
           <type name="int" c:type="int*"/>
         </parameter>
         <parameter name="ints"
                    direction="inout"
+                   caller-allocates="0"
                    transfer-ownership="full"
                    doc="a list of integers whose items will be increased by 1, except the first that will be dropped">
           <array length="0" c:type="int**">
@@ -795,7 +827,10 @@ case.">
         </array>
       </return-value>
       <parameters>
-        <parameter name="len" direction="out" transfer-ownership="full">
+        <parameter name="len"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="int*"/>
         </parameter>
       </parameters>
@@ -824,6 +859,7 @@ case.">
       <parameters>
         <parameter name="arr"
                    direction="out"
+                   caller-allocates="0"
                    transfer-ownership="full"
                    allow-none="1">
           <array length="1" c:type="int**">
@@ -832,6 +868,7 @@ case.">
         </parameter>
         <parameter name="len"
                    direction="out"
+                   caller-allocates="0"
                    transfer-ownership="full"
                    doc=": length">
           <type name="int" c:type="int*"/>
@@ -845,12 +882,14 @@ case.">
       <parameters>
         <parameter name="n_ints"
                    direction="out"
+                   caller-allocates="0"
                    transfer-ownership="full"
                    doc="the length of @ints">
           <type name="int" c:type="int*"/>
         </parameter>
         <parameter name="ints"
                    direction="out"
+                   caller-allocates="0"
                    transfer-ownership="full"
                    doc="a list of 5 integers, from 0 to 4 in consecutive order">
           <array length="0" c:type="int**">
@@ -923,7 +962,10 @@ case.">
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="surface" direction="out" transfer-ownership="full">
+        <parameter name="surface"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="cairo.Surface" c:type="cairo_surface_t**"/>
         </parameter>
       </parameters>
@@ -1248,6 +1290,7 @@ call and can be released on return.">
       <parameters>
         <parameter name="out"
                    direction="out"
+                   caller-allocates="0"
                    transfer-ownership="full"
                    allow-none="1">
           <type name="GLib.HashTable" c:type="GHashTable**">
@@ -1381,6 +1424,7 @@ call and can be released on return.">
       <parameters>
         <parameter name="out_list"
                    direction="out"
+                   caller-allocates="0"
                    transfer-ownership="full"
                    allow-none="1">
           <type name="GLib.SList" c:type="GSList**">
@@ -1504,6 +1548,7 @@ call and can be released on return.">
       <parameters>
         <parameter name="out_list"
                    direction="out"
+                   caller-allocates="0"
                    transfer-ownership="full"
                    allow-none="1">
           <type name="GLib.SList" c:type="GSList**">
@@ -1577,7 +1622,10 @@ call and can be released on return.">
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="length" direction="out" transfer-ownership="full">
+        <parameter name="length"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="int*"/>
         </parameter>
         <parameter name="in" transfer-ownership="none">
@@ -1627,10 +1675,16 @@ call and can be released on return.">
         <parameter name="in" transfer-ownership="none">
           <type name="double" c:type="gdouble"/>
         </parameter>
-        <parameter name="one" direction="out" transfer-ownership="full">
+        <parameter name="one"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="double" c:type="gdouble*"/>
         </parameter>
-        <parameter name="two" direction="out" transfer-ownership="full">
+        <parameter name="two"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="double" c:type="gdouble*"/>
         </parameter>
       </parameters>
@@ -1655,6 +1709,7 @@ call and can be released on return.">
       <parameters>
         <parameter name="obj"
                    direction="out"
+                   caller-allocates="0"
                    transfer-ownership="full"
                    allow-none="1"
                    doc="A #TestObj">
@@ -1767,7 +1822,10 @@ call and can be released on return.">
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="retp" direction="out" transfer-ownership="container">
+        <parameter name="retp"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="container">
           <array c:type="char***">
             <type name="utf8"/>
           </array>
@@ -1793,16 +1851,25 @@ call and can be released on return.">
         <parameter name="x" transfer-ownership="none">
           <type name="int" c:type="int"/>
         </parameter>
-        <parameter name="y" direction="out" transfer-ownership="full">
+        <parameter name="y"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="double" c:type="double*"/>
         </parameter>
-        <parameter name="z" direction="out" transfer-ownership="full">
+        <parameter name="z"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="int*"/>
         </parameter>
         <parameter name="foo" transfer-ownership="none">
           <type name="utf8" c:type="char*"/>
         </parameter>
-        <parameter name="q" direction="out" transfer-ownership="full">
+        <parameter name="q"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="int*"/>
         </parameter>
         <parameter name="m" transfer-ownership="none">
@@ -1821,16 +1888,25 @@ call and can be released on return.">
         <parameter name="x" transfer-ownership="none">
           <type name="int" c:type="int"/>
         </parameter>
-        <parameter name="y" direction="out" transfer-ownership="full">
+        <parameter name="y"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="double" c:type="double*"/>
         </parameter>
-        <parameter name="z" direction="out" transfer-ownership="full">
+        <parameter name="z"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="int*"/>
         </parameter>
         <parameter name="foo" transfer-ownership="none">
           <type name="utf8" c:type="char*"/>
         </parameter>
-        <parameter name="q" direction="out" transfer-ownership="full">
+        <parameter name="q"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="int*"/>
         </parameter>
         <parameter name="m" transfer-ownership="none">
@@ -1860,16 +1936,25 @@ call and can be released on return.">
         <parameter name="notify" transfer-ownership="none" scope="call">
           <type name="GLib.DestroyNotify" c:type="GDestroyNotify"/>
         </parameter>
-        <parameter name="y" direction="out" transfer-ownership="full">
+        <parameter name="y"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="double" c:type="double*"/>
         </parameter>
-        <parameter name="z" direction="out" transfer-ownership="full">
+        <parameter name="z"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="int*"/>
         </parameter>
         <parameter name="foo" transfer-ownership="none">
           <type name="utf8" c:type="char*"/>
         </parameter>
-        <parameter name="q" direction="out" transfer-ownership="full">
+        <parameter name="q"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="int*"/>
         </parameter>
         <parameter name="m" transfer-ownership="none">
@@ -1968,7 +2053,10 @@ call and can be released on return.">
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="inout" direction="inout" transfer-ownership="full">
+        <parameter name="inout"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="utf8" c:type="char**"/>
         </parameter>
       </parameters>
@@ -2007,6 +2095,7 @@ call and can be released on return.">
       <parameters>
         <parameter name="char_out"
                    direction="out"
+                   caller-allocates="0"
                    transfer-ownership="full"
                    allow-none="1">
           <type name="utf8" c:type="char**"/>
@@ -2018,7 +2107,10 @@ call and can be released on return.">
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="out" direction="out" transfer-ownership="full">
+        <parameter name="out"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="utf8" c:type="char**"/>
         </parameter>
       </parameters>
@@ -2032,6 +2124,7 @@ call and can be released on return.">
       <parameters>
         <parameter name="out"
                    direction="out"
+                   caller-allocates="0"
                    transfer-ownership="full"
                    doc="a copy of &quot;second&quot;">
           <type name="utf8" c:type="char**"/>
@@ -2045,12 +2138,14 @@ call and can be released on return.">
       <parameters>
         <parameter name="out0"
                    direction="out"
+                   caller-allocates="0"
                    transfer-ownership="full"
                    doc="a copy of &quot;first&quot;">
           <type name="utf8" c:type="char**"/>
         </parameter>
         <parameter name="out1"
                    direction="out"
+                   caller-allocates="0"
                    transfer-ownership="full"
                    doc="a copy of &quot;second&quot;">
           <type name="utf8" c:type="char**"/>
diff --git a/gir/GIMarshallingTests-1.0-expected.gir b/gir/GIMarshallingTests-1.0-expected.gir
index ee2d315..743b94d 100644
--- a/gir/GIMarshallingTests-1.0-expected.gir
+++ b/gir/GIMarshallingTests-1.0-expected.gir
@@ -177,7 +177,10 @@ and/or use gtk-doc annotations.  -->
           <type name="none" c:type="void"/>
         </return-value>
         <parameters>
-          <parameter name="out" direction="out" transfer-ownership="full">
+          <parameter name="out"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="full">
             <type name="int8" c:type="gint8*"/>
           </parameter>
         </parameters>
@@ -226,12 +229,18 @@ and/or use gtk-doc annotations.  -->
           <type name="none" c:type="void"/>
         </return-value>
         <parameters>
-          <parameter name="ints" direction="out" transfer-ownership="none">
+          <parameter name="ints"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="none">
             <array length="2" c:type="gint**">
               <type name="int"/>
             </array>
           </parameter>
-          <parameter name="length" direction="out" transfer-ownership="full">
+          <parameter name="length"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="full">
             <type name="int" c:type="gint*"/>
           </parameter>
         </parameters>
@@ -242,12 +251,18 @@ and/or use gtk-doc annotations.  -->
           <type name="none" c:type="void"/>
         </return-value>
         <parameters>
-          <parameter name="ints" direction="inout" transfer-ownership="none">
+          <parameter name="ints"
+                     direction="inout"
+                     caller-allocates="0"
+                     transfer-ownership="none">
             <array length="2" c:type="gint**">
               <type name="int"/>
             </array>
           </parameter>
-          <parameter name="length" direction="inout" transfer-ownership="full">
+          <parameter name="length"
+                     direction="inout"
+                     caller-allocates="0"
+                     transfer-ownership="full">
             <type name="int" c:type="gint*"/>
           </parameter>
         </parameters>
@@ -260,7 +275,10 @@ and/or use gtk-doc annotations.  -->
           </array>
         </return-value>
         <parameters>
-          <parameter name="length" direction="out" transfer-ownership="full">
+          <parameter name="length"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="full">
             <type name="int" c:type="gint*"/>
           </parameter>
         </parameters>
@@ -282,7 +300,10 @@ and/or use gtk-doc annotations.  -->
           <type name="none" c:type="void"/>
         </return-value>
         <parameters>
-          <parameter name="out" direction="out" transfer-ownership="full">
+          <parameter name="out"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="full">
             <type name="int8" c:type="gint8*"/>
           </parameter>
         </parameters>
@@ -338,7 +359,10 @@ and/or use gtk-doc annotations.  -->
             <parameter name="self" transfer-ownership="none">
               <type name="Object" c:type="GIMarshallingTestsObject*"/>
             </parameter>
-            <parameter name="out" direction="out" transfer-ownership="full">
+            <parameter name="out"
+                       direction="out"
+                       caller-allocates="0"
+                       transfer-ownership="full">
               <type name="int8" c:type="gint8*"/>
             </parameter>
           </parameters>
@@ -482,7 +506,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="ints" direction="inout" transfer-ownership="none">
+        <parameter name="ints"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <array c:type="gint**" fixed-size="4">
             <type name="int"/>
           </array>
@@ -516,7 +543,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="ints" direction="out" transfer-ownership="none">
+        <parameter name="ints"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <array c:type="gint**" fixed-size="4">
             <type name="int"/>
           </array>
@@ -529,7 +559,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="structs" direction="out" transfer-ownership="none">
+        <parameter name="structs"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <array c:type="GIMarshallingTestsSimpleStruct**" fixed-size="2">
             <type name="SimpleStruct"/>
           </array>
@@ -578,12 +611,18 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="ints" direction="inout" transfer-ownership="none">
+        <parameter name="ints"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <array length="1" c:type="gint**">
             <type name="int"/>
           </array>
         </parameter>
-        <parameter name="length" direction="inout" transfer-ownership="full">
+        <parameter name="length"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="gint*"/>
         </parameter>
       </parameters>
@@ -593,12 +632,18 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="ints" direction="out" transfer-ownership="none">
+        <parameter name="ints"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <array length="1" c:type="gint**">
             <type name="int"/>
           </array>
         </parameter>
-        <parameter name="length" direction="out" transfer-ownership="full">
+        <parameter name="length"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="gint*"/>
         </parameter>
       </parameters>
@@ -611,7 +656,10 @@ and/or use gtk-doc annotations.  -->
         </array>
       </return-value>
       <parameters>
-        <parameter name="length" direction="out" transfer-ownership="full">
+        <parameter name="length"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="gint*"/>
         </parameter>
       </parameters>
@@ -635,7 +683,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="utf8s" direction="inout" transfer-ownership="none">
+        <parameter name="utf8s"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <array c:type="gchar***">
             <type name="utf8"/>
           </array>
@@ -648,7 +699,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="utf8s" direction="out" transfer-ownership="none">
+        <parameter name="utf8s"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <array c:type="gchar***">
             <type name="utf8"/>
           </array>
@@ -691,7 +745,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="bool_" direction="inout" transfer-ownership="full">
+        <parameter name="bool_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="boolean" c:type="gboolean*"/>
         </parameter>
       </parameters>
@@ -702,7 +759,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="bool_" direction="inout" transfer-ownership="full">
+        <parameter name="bool_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="boolean" c:type="gboolean*"/>
         </parameter>
       </parameters>
@@ -713,7 +773,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="bool_" direction="out" transfer-ownership="full">
+        <parameter name="bool_"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="boolean" c:type="gboolean*"/>
         </parameter>
       </parameters>
@@ -724,7 +787,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="bool_" direction="out" transfer-ownership="full">
+        <parameter name="bool_"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="boolean" c:type="gboolean*"/>
         </parameter>
       </parameters>
@@ -758,7 +824,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="struct_" direction="inout" transfer-ownership="none">
+        <parameter name="struct_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="BoxedStruct" c:type="GIMarshallingTestsBoxedStruct**"/>
         </parameter>
       </parameters>
@@ -769,7 +838,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="struct_" direction="out" transfer-ownership="none">
+        <parameter name="struct_"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="BoxedStruct" c:type="GIMarshallingTestsBoxedStruct**"/>
         </parameter>
       </parameters>
@@ -796,7 +868,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="double_" direction="inout" transfer-ownership="full">
+        <parameter name="double_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="double" c:type="gdouble*"/>
         </parameter>
       </parameters>
@@ -807,7 +882,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="double_" direction="out" transfer-ownership="full">
+        <parameter name="double_"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="double" c:type="gdouble*"/>
         </parameter>
       </parameters>
@@ -834,7 +912,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="enum_" direction="inout" transfer-ownership="full">
+        <parameter name="enum_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="Enum" c:type="GIMarshallingTestsEnum*"/>
         </parameter>
       </parameters>
@@ -844,7 +925,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="enum_" direction="out" transfer-ownership="full">
+        <parameter name="enum_"
+                   direction="out"
+                   caller-allocates="1"
+                   transfer-ownership="none">
           <type name="Enum" c:type="GIMarshallingTestsEnum*"/>
         </parameter>
       </parameters>
@@ -888,7 +972,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="flags_" direction="inout" transfer-ownership="full">
+        <parameter name="flags_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="Flags" c:type="GIMarshallingTestsFlags*"/>
         </parameter>
       </parameters>
@@ -898,7 +985,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="flags_" direction="out" transfer-ownership="full">
+        <parameter name="flags_"
+                   direction="out"
+                   caller-allocates="1"
+                   transfer-ownership="none">
           <type name="Flags" c:type="GIMarshallingTestsFlags*"/>
         </parameter>
       </parameters>
@@ -925,7 +1015,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="float_" direction="inout" transfer-ownership="full">
+        <parameter name="float_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="float" c:type="gfloat*"/>
         </parameter>
       </parameters>
@@ -935,7 +1028,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="float_" direction="out" transfer-ownership="full">
+        <parameter name="float_"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="float" c:type="gfloat*"/>
         </parameter>
       </parameters>
@@ -988,6 +1084,7 @@ and/or use gtk-doc annotations.  -->
       <parameters>
         <parameter name="array_"
                    direction="inout"
+                   caller-allocates="0"
                    transfer-ownership="container">
           <array name="GLib.Array" c:type="GArray**">
             <type name="utf8"/>
@@ -1003,6 +1100,7 @@ and/or use gtk-doc annotations.  -->
       <parameters>
         <parameter name="array_"
                    direction="out"
+                   caller-allocates="0"
                    transfer-ownership="container">
           <array name="GLib.Array" c:type="GArray**">
             <type name="utf8"/>
@@ -1037,7 +1135,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="array_" direction="inout" transfer-ownership="full">
+        <parameter name="array_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <array name="GLib.Array" c:type="GArray**">
             <type name="utf8"/>
           </array>
@@ -1050,7 +1151,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="array_" direction="out" transfer-ownership="full">
+        <parameter name="array_"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <array name="GLib.Array" c:type="GArray**">
             <type name="utf8"/>
           </array>
@@ -1084,7 +1188,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="array_" direction="inout" transfer-ownership="none">
+        <parameter name="array_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <array name="GLib.Array" c:type="GArray**">
             <type name="utf8"/>
           </array>
@@ -1097,7 +1204,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="array_" direction="out" transfer-ownership="none">
+        <parameter name="array_"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <array name="GLib.Array" c:type="GArray**">
             <type name="utf8"/>
           </array>
@@ -1139,7 +1249,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="enum_" direction="inout" transfer-ownership="full">
+        <parameter name="enum_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="GEnum" c:type="GIMarshallingTestsGEnum*"/>
         </parameter>
       </parameters>
@@ -1149,7 +1262,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="enum_" direction="out" transfer-ownership="full">
+        <parameter name="enum_"
+                   direction="out"
+                   caller-allocates="1"
+                   transfer-ownership="none">
           <type name="GEnum" c:type="GIMarshallingTestsGEnum*"/>
         </parameter>
       </parameters>
@@ -1205,6 +1321,7 @@ and/or use gtk-doc annotations.  -->
       <parameters>
         <parameter name="hash_table"
                    direction="inout"
+                   caller-allocates="0"
                    transfer-ownership="container">
           <type name="GLib.HashTable" c:type="GHashTable**">
             <type name="utf8"/>
@@ -1221,6 +1338,7 @@ and/or use gtk-doc annotations.  -->
       <parameters>
         <parameter name="hash_table"
                    direction="out"
+                   caller-allocates="0"
                    transfer-ownership="container">
           <type name="GLib.HashTable" c:type="GHashTable**">
             <type name="utf8"/>
@@ -1260,6 +1378,7 @@ and/or use gtk-doc annotations.  -->
       <parameters>
         <parameter name="hash_table"
                    direction="inout"
+                   caller-allocates="0"
                    transfer-ownership="full">
           <type name="GLib.HashTable" c:type="GHashTable**">
             <type name="utf8"/>
@@ -1274,7 +1393,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="hash_table" direction="out" transfer-ownership="full">
+        <parameter name="hash_table"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="GLib.HashTable" c:type="GHashTable**">
             <type name="utf8"/>
             <type name="utf8"/>
@@ -1313,6 +1435,7 @@ and/or use gtk-doc annotations.  -->
       <parameters>
         <parameter name="hash_table"
                    direction="inout"
+                   caller-allocates="0"
                    transfer-ownership="none">
           <type name="GLib.HashTable" c:type="GHashTable**">
             <type name="utf8"/>
@@ -1327,7 +1450,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="hash_table" direction="out" transfer-ownership="none">
+        <parameter name="hash_table"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="GLib.HashTable" c:type="GHashTable**">
             <type name="utf8"/>
             <type name="utf8"/>
@@ -1386,6 +1512,7 @@ and/or use gtk-doc annotations.  -->
       <parameters>
         <parameter name="list"
                    direction="inout"
+                   caller-allocates="0"
                    transfer-ownership="container">
           <type name="GLib.List" c:type="GList**">
             <type name="utf8"/>
@@ -1399,7 +1526,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="list" direction="out" transfer-ownership="container">
+        <parameter name="list"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="container">
           <type name="GLib.List" c:type="GList**">
             <type name="utf8"/>
           </type>
@@ -1433,7 +1563,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="list" direction="inout" transfer-ownership="full">
+        <parameter name="list"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="GLib.List" c:type="GList**">
             <type name="utf8"/>
           </type>
@@ -1446,7 +1579,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="list" direction="out" transfer-ownership="full">
+        <parameter name="list"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="GLib.List" c:type="GList**">
             <type name="utf8"/>
           </type>
@@ -1480,7 +1616,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="list" direction="inout" transfer-ownership="none">
+        <parameter name="list"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="GLib.List" c:type="GList**">
             <type name="utf8"/>
           </type>
@@ -1493,7 +1632,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="list" direction="out" transfer-ownership="none">
+        <parameter name="list"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="GLib.List" c:type="GList**">
             <type name="utf8"/>
           </type>
@@ -1550,6 +1692,7 @@ and/or use gtk-doc annotations.  -->
       <parameters>
         <parameter name="list"
                    direction="inout"
+                   caller-allocates="0"
                    transfer-ownership="container">
           <type name="GLib.SList" c:type="GSList**">
             <type name="utf8"/>
@@ -1563,7 +1706,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="list" direction="out" transfer-ownership="container">
+        <parameter name="list"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="container">
           <type name="GLib.SList" c:type="GSList**">
             <type name="utf8"/>
           </type>
@@ -1597,7 +1743,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="list" direction="inout" transfer-ownership="full">
+        <parameter name="list"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="GLib.SList" c:type="GSList**">
             <type name="utf8"/>
           </type>
@@ -1610,7 +1759,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="list" direction="out" transfer-ownership="full">
+        <parameter name="list"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="GLib.SList" c:type="GSList**">
             <type name="utf8"/>
           </type>
@@ -1644,7 +1796,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="list" direction="inout" transfer-ownership="none">
+        <parameter name="list"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="GLib.SList" c:type="GSList**">
             <type name="utf8"/>
           </type>
@@ -1657,7 +1812,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="list" direction="out" transfer-ownership="none">
+        <parameter name="list"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="GLib.SList" c:type="GSList**">
             <type name="utf8"/>
           </type>
@@ -1688,7 +1846,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="gtype" direction="inout" transfer-ownership="full">
+        <parameter name="gtype"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="GType" c:type="GType*"/>
         </parameter>
       </parameters>
@@ -1698,7 +1859,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="gtype" direction="out" transfer-ownership="full">
+        <parameter name="gtype"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="GType" c:type="GType*"/>
         </parameter>
       </parameters>
@@ -1725,7 +1889,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="value" direction="inout" transfer-ownership="none">
+        <parameter name="value"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="GObject.Value" c:type="GValue**"/>
         </parameter>
       </parameters>
@@ -1736,7 +1903,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="value" direction="out" transfer-ownership="none">
+        <parameter name="value"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="GObject.Value" c:type="GValue**"/>
         </parameter>
       </parameters>
@@ -1775,7 +1945,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int16" direction="inout" transfer-ownership="full">
+        <parameter name="int16"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int16" c:type="gint16*"/>
         </parameter>
       </parameters>
@@ -1786,7 +1959,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int16" direction="inout" transfer-ownership="full">
+        <parameter name="int16"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int16" c:type="gint16*"/>
         </parameter>
       </parameters>
@@ -1797,7 +1973,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int16" direction="out" transfer-ownership="full">
+        <parameter name="int16"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int16" c:type="gint16*"/>
         </parameter>
       </parameters>
@@ -1808,7 +1987,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int16" direction="out" transfer-ownership="full">
+        <parameter name="int16"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int16" c:type="gint16*"/>
         </parameter>
       </parameters>
@@ -1853,7 +2035,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int32" direction="inout" transfer-ownership="full">
+        <parameter name="int32"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int32" c:type="gint32*"/>
         </parameter>
       </parameters>
@@ -1864,7 +2049,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int32" direction="inout" transfer-ownership="full">
+        <parameter name="int32"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int32" c:type="gint32*"/>
         </parameter>
       </parameters>
@@ -1875,7 +2063,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int32" direction="out" transfer-ownership="full">
+        <parameter name="int32"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int32" c:type="gint32*"/>
         </parameter>
       </parameters>
@@ -1886,7 +2077,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int32" direction="out" transfer-ownership="full">
+        <parameter name="int32"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int32" c:type="gint32*"/>
         </parameter>
       </parameters>
@@ -1931,7 +2125,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int64" direction="inout" transfer-ownership="full">
+        <parameter name="int64"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int64" c:type="gint64*"/>
         </parameter>
       </parameters>
@@ -1942,7 +2139,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int64" direction="inout" transfer-ownership="full">
+        <parameter name="int64"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int64" c:type="gint64*"/>
         </parameter>
       </parameters>
@@ -1953,7 +2153,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int64" direction="out" transfer-ownership="full">
+        <parameter name="int64"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int64" c:type="gint64*"/>
         </parameter>
       </parameters>
@@ -1964,7 +2167,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int64" direction="out" transfer-ownership="full">
+        <parameter name="int64"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int64" c:type="gint64*"/>
         </parameter>
       </parameters>
@@ -2009,7 +2215,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int8" direction="inout" transfer-ownership="full">
+        <parameter name="int8"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int8" c:type="gint8*"/>
         </parameter>
       </parameters>
@@ -2020,7 +2229,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int8" direction="inout" transfer-ownership="full">
+        <parameter name="int8"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int8" c:type="gint8*"/>
         </parameter>
       </parameters>
@@ -2031,7 +2243,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int8" direction="out" transfer-ownership="full">
+        <parameter name="int8"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int8" c:type="gint8*"/>
         </parameter>
       </parameters>
@@ -2042,7 +2257,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int8" direction="out" transfer-ownership="full">
+        <parameter name="int8"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int8" c:type="gint8*"/>
         </parameter>
       </parameters>
@@ -2087,7 +2305,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int_" direction="inout" transfer-ownership="full">
+        <parameter name="int_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="gint*"/>
         </parameter>
       </parameters>
@@ -2098,7 +2319,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int_" direction="inout" transfer-ownership="full">
+        <parameter name="int_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="gint*"/>
         </parameter>
       </parameters>
@@ -2109,7 +2333,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int0" direction="out" transfer-ownership="full">
+        <parameter name="int0"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="gint*"/>
         </parameter>
         <parameter name="int1" transfer-ownership="none">
@@ -2123,7 +2350,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int_" direction="out" transfer-ownership="full">
+        <parameter name="int_"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="gint*"/>
         </parameter>
       </parameters>
@@ -2134,7 +2364,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int_" direction="out" transfer-ownership="full">
+        <parameter name="int_"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="gint*"/>
         </parameter>
       </parameters>
@@ -2145,10 +2378,16 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="int0" direction="out" transfer-ownership="full">
+        <parameter name="int0"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="gint*"/>
         </parameter>
-        <parameter name="int1" direction="out" transfer-ownership="full">
+        <parameter name="int1"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="gint*"/>
         </parameter>
       </parameters>
@@ -2171,7 +2410,10 @@ and/or use gtk-doc annotations.  -->
         <type name="int" c:type="gint"/>
       </return-value>
       <parameters>
-        <parameter name="int_" direction="out" transfer-ownership="full">
+        <parameter name="int_"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int" c:type="gint*"/>
         </parameter>
       </parameters>
@@ -2204,7 +2446,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="long_" direction="inout" transfer-ownership="full">
+        <parameter name="long_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="long" c:type="glong*"/>
         </parameter>
       </parameters>
@@ -2215,7 +2460,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="long_" direction="inout" transfer-ownership="full">
+        <parameter name="long_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="long" c:type="glong*"/>
         </parameter>
       </parameters>
@@ -2226,7 +2474,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="long_" direction="out" transfer-ownership="full">
+        <parameter name="long_"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="long" c:type="glong*"/>
         </parameter>
       </parameters>
@@ -2237,7 +2488,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="long_" direction="out" transfer-ownership="full">
+        <parameter name="long_"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="long" c:type="glong*"/>
         </parameter>
       </parameters>
@@ -2271,7 +2525,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="object" direction="inout" transfer-ownership="full">
+        <parameter name="object"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="Object" c:type="GIMarshallingTestsObject**"/>
         </parameter>
       </parameters>
@@ -2282,7 +2539,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="object" direction="out" transfer-ownership="full">
+        <parameter name="object"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="Object" c:type="GIMarshallingTestsObject**"/>
         </parameter>
       </parameters>
@@ -2299,7 +2559,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="object" direction="inout" transfer-ownership="full">
+        <parameter name="object"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="Object" c:type="GIMarshallingTestsObject**"/>
         </parameter>
       </parameters>
@@ -2327,7 +2590,10 @@ and/or use gtk-doc annotations.  -->
         <parameter name="object" transfer-ownership="none">
           <type name="Object" c:type="GIMarshallingTestsObject*"/>
         </parameter>
-        <parameter name="out" direction="out" transfer-ownership="full">
+        <parameter name="out"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="int8" c:type="gint8*"/>
         </parameter>
       </parameters>
@@ -2349,7 +2615,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="object" direction="inout" transfer-ownership="none">
+        <parameter name="object"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="Object" c:type="GIMarshallingTestsObject**"/>
         </parameter>
       </parameters>
@@ -2360,7 +2629,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="object" direction="out" transfer-ownership="none">
+        <parameter name="object"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="Object" c:type="GIMarshallingTestsObject**"/>
         </parameter>
       </parameters>
@@ -2414,7 +2686,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="struct_" direction="inout" transfer-ownership="none">
+        <parameter name="struct_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="PointerStruct"
                 c:type="GIMarshallingTestsPointerStruct**"/>
         </parameter>
@@ -2426,7 +2701,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="struct_" direction="out" transfer-ownership="none">
+        <parameter name="struct_"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="PointerStruct"
                 c:type="GIMarshallingTestsPointerStruct**"/>
         </parameter>
@@ -2466,7 +2744,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="short_" direction="inout" transfer-ownership="full">
+        <parameter name="short_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="short" c:type="gshort*"/>
         </parameter>
       </parameters>
@@ -2477,7 +2758,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="short_" direction="inout" transfer-ownership="full">
+        <parameter name="short_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="short" c:type="gshort*"/>
         </parameter>
       </parameters>
@@ -2488,7 +2772,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="short_" direction="out" transfer-ownership="full">
+        <parameter name="short_"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="short" c:type="gshort*"/>
         </parameter>
       </parameters>
@@ -2499,7 +2786,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="short_" direction="out" transfer-ownership="full">
+        <parameter name="short_"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="short" c:type="gshort*"/>
         </parameter>
       </parameters>
@@ -2533,7 +2823,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="struct_" direction="inout" transfer-ownership="none">
+        <parameter name="struct_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="SimpleStruct" c:type="GIMarshallingTestsSimpleStruct**"/>
         </parameter>
       </parameters>
@@ -2544,7 +2837,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="struct_" direction="out" transfer-ownership="none">
+        <parameter name="struct_"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="SimpleStruct" c:type="GIMarshallingTestsSimpleStruct**"/>
         </parameter>
       </parameters>
@@ -2571,7 +2867,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="size" direction="inout" transfer-ownership="full">
+        <parameter name="size"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="size_t" c:type="gsize*"/>
         </parameter>
       </parameters>
@@ -2581,7 +2880,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="size" direction="out" transfer-ownership="full">
+        <parameter name="size"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="size_t" c:type="gsize*"/>
         </parameter>
       </parameters>
@@ -2620,7 +2922,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="ssize" direction="inout" transfer-ownership="full">
+        <parameter name="ssize"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="ssize_t" c:type="gssize*"/>
         </parameter>
       </parameters>
@@ -2631,7 +2936,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="ssize" direction="inout" transfer-ownership="full">
+        <parameter name="ssize"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="ssize_t" c:type="gssize*"/>
         </parameter>
       </parameters>
@@ -2642,7 +2950,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="ssize" direction="out" transfer-ownership="full">
+        <parameter name="ssize"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="ssize_t" c:type="gssize*"/>
         </parameter>
       </parameters>
@@ -2653,7 +2964,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="ssize" direction="out" transfer-ownership="full">
+        <parameter name="ssize"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="ssize_t" c:type="gssize*"/>
         </parameter>
       </parameters>
@@ -2700,7 +3014,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="time_t_" direction="inout" transfer-ownership="full">
+        <parameter name="time_t_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="time_t" c:type="time_t*"/>
         </parameter>
       </parameters>
@@ -2711,7 +3028,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="time_t_" direction="out" transfer-ownership="full">
+        <parameter name="time_t_"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="time_t" c:type="time_t*"/>
         </parameter>
       </parameters>
@@ -2738,7 +3058,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="uint16" direction="inout" transfer-ownership="full">
+        <parameter name="uint16"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="uint16" c:type="guint16*"/>
         </parameter>
       </parameters>
@@ -2749,7 +3072,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="uint16" direction="out" transfer-ownership="full">
+        <parameter name="uint16"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="uint16" c:type="guint16*"/>
         </parameter>
       </parameters>
@@ -2776,7 +3102,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="uint32" direction="inout" transfer-ownership="full">
+        <parameter name="uint32"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="uint32" c:type="guint32*"/>
         </parameter>
       </parameters>
@@ -2787,7 +3116,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="uint32" direction="out" transfer-ownership="full">
+        <parameter name="uint32"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="uint32" c:type="guint32*"/>
         </parameter>
       </parameters>
@@ -2814,7 +3146,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="uint64" direction="inout" transfer-ownership="full">
+        <parameter name="uint64"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="uint64" c:type="guint64*"/>
         </parameter>
       </parameters>
@@ -2825,7 +3160,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="uint64" direction="out" transfer-ownership="full">
+        <parameter name="uint64"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="uint64" c:type="guint64*"/>
         </parameter>
       </parameters>
@@ -2852,7 +3190,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="uint8" direction="inout" transfer-ownership="full">
+        <parameter name="uint8"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="uint8" c:type="guint8*"/>
         </parameter>
       </parameters>
@@ -2862,7 +3203,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="uint8" direction="out" transfer-ownership="full">
+        <parameter name="uint8"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="uint8" c:type="guint8*"/>
         </parameter>
       </parameters>
@@ -2889,7 +3233,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="uint" direction="inout" transfer-ownership="full">
+        <parameter name="uint"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="uint" c:type="guint*"/>
         </parameter>
       </parameters>
@@ -2899,7 +3246,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="uint" direction="out" transfer-ownership="full">
+        <parameter name="uint"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="uint" c:type="guint*"/>
         </parameter>
       </parameters>
@@ -2926,7 +3276,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="ulong" direction="inout" transfer-ownership="full">
+        <parameter name="ulong"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="ulong" c:type="gulong*"/>
         </parameter>
       </parameters>
@@ -2936,7 +3289,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="ulong" direction="out" transfer-ownership="full">
+        <parameter name="ulong"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="ulong" c:type="gulong*"/>
         </parameter>
       </parameters>
@@ -2963,7 +3319,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="union_" direction="inout" transfer-ownership="none">
+        <parameter name="union_"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="Union" c:type="GIMarshallingTestsUnion**"/>
         </parameter>
       </parameters>
@@ -2973,7 +3332,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="union_" direction="out" transfer-ownership="none">
+        <parameter name="union_"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="Union" c:type="GIMarshallingTestsUnion**"/>
         </parameter>
       </parameters>
@@ -3000,7 +3362,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="ushort" direction="inout" transfer-ownership="full">
+        <parameter name="ushort"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="ushort" c:type="gushort*"/>
         </parameter>
       </parameters>
@@ -3011,7 +3376,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="ushort" direction="out" transfer-ownership="full">
+        <parameter name="ushort"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="ushort" c:type="gushort*"/>
         </parameter>
       </parameters>
@@ -3028,7 +3396,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="utf8" direction="out" transfer-ownership="full">
+        <parameter name="utf8"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="utf8" c:type="gchar**"/>
         </parameter>
       </parameters>
@@ -3050,7 +3421,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="utf8" direction="inout" transfer-ownership="full">
+        <parameter name="utf8"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="utf8" c:type="gchar**"/>
         </parameter>
       </parameters>
@@ -3061,7 +3435,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="utf8" direction="out" transfer-ownership="full">
+        <parameter name="utf8"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <type name="utf8" c:type="gchar**"/>
         </parameter>
       </parameters>
@@ -3107,7 +3484,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="utf8" direction="inout" transfer-ownership="none">
+        <parameter name="utf8"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="utf8" c:type="gchar**"/>
         </parameter>
       </parameters>
@@ -3118,7 +3498,10 @@ and/or use gtk-doc annotations.  -->
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="utf8" direction="out" transfer-ownership="none">
+        <parameter name="utf8"
+                   direction="out"
+                   caller-allocates="0"
+                   transfer-ownership="none">
           <type name="utf8" c:type="gchar**"/>
         </parameter>
       </parameters>
diff --git a/gir/everything.c b/gir/everything.c
index a603cc5..389d9a3 100644
--- a/gir/everything.c
+++ b/gir/everything.c
@@ -1325,7 +1325,7 @@ test_enum_param(TestEnum e)
 /**
  * test_struct_a_clone:
  * @a: the structure
- * @a_out: the cloned structure
+ * @a_out: (out caller-allocates): the cloned structure
  *
  * Make a copy of a TestStructA
  */
@@ -1339,7 +1339,7 @@ test_struct_a_clone (TestStructA *a,
 /**
  * test_struct_b_clone:
  * @b: the structure
- * @b_out: the cloned structure
+ * @b_out: (out): the cloned structure
  *
  * Make a copy of a TestStructB
  */
diff --git a/girepository/ginfo.c b/girepository/ginfo.c
index 3099885..48ebe03 100644
--- a/girepository/ginfo.c
+++ b/girepository/ginfo.c
@@ -1021,21 +1021,23 @@ g_arg_info_is_return_value (GIArgInfo *info)
 }
 
 /**
- * g_arg_info_is_dipper:
+ * g_arg_info_is_caller_allocates:
  * @info: a #GIArgInfo
  *
  * Obtain if the argument is a pointer to a struct or object that will
- * receive an output of a function.
+ * receive an output of a function.  The default assumption for
+ * %GI_DIRECTION_OUT arguments which have allocation is that the
+ * callee allocates; if this is %TRUE, then the caller must allocate.
  *
- * Returns: %TRUE if it is a dipper argument
+ * Returns: %TRUE if caller is required to have allocated the argument
  */
 gboolean
-g_arg_info_is_dipper (GIArgInfo *info)
+g_arg_info_is_caller_allocates (GIArgInfo *info)
 {
   GIRealInfo *rinfo = (GIRealInfo *)info;
   ArgBlob *blob = (ArgBlob *)&rinfo->typelib->data[rinfo->offset];
 
-  return blob->dipper;
+  return blob->caller_allocates;
 }
 
 /**
diff --git a/girepository/girepository.h b/girepository/girepository.h
index 66afbff..f322564 100644
--- a/girepository/girepository.h
+++ b/girepository/girepository.h
@@ -551,6 +551,7 @@ GIDirection            g_arg_info_get_direction          (GIArgInfo *info);
 gboolean               g_arg_info_is_dipper              (GIArgInfo *info);
 gboolean               g_arg_info_is_return_value        (GIArgInfo *info);
 gboolean               g_arg_info_is_optional            (GIArgInfo *info);
+gboolean               g_arg_info_is_caller_allocates    (GIArgInfo *info);
 gboolean               g_arg_info_may_be_null            (GIArgInfo *info);
 GITransfer             g_arg_info_get_ownership_transfer (GIArgInfo *info);
 GIScopeType            g_arg_info_get_scope              (GIArgInfo *info);
diff --git a/girepository/girnode.c b/girepository/girnode.c
index 6f4a44a..9ff3235 100644
--- a/girepository/girnode.c
+++ b/girepository/girnode.c
@@ -1864,7 +1864,7 @@ g_ir_node_build_typelib (GIrNode         *node,
 	blob->name = write_string (node->name, strings, data, offset2);
 	blob->in = param->in;
 	blob->out = param->out;
-	blob->dipper = param->dipper;
+	blob->caller_allocates = param->caller_allocates;
 	blob->allow_none = param->allow_none;
 	blob->optional = param->optional;
 	blob->transfer_ownership = param->transfer;
diff --git a/girepository/girnode.h b/girepository/girnode.h
index 5e6cba0..8c7b14e 100644
--- a/girepository/girnode.h
+++ b/girepository/girnode.h
@@ -153,7 +153,7 @@ struct _GIrNodeParam
 
   gboolean in;
   gboolean out;
-  gboolean dipper;
+  gboolean caller_allocates;
   gboolean optional;
   gboolean retval;
   gboolean allow_none;
diff --git a/girepository/girparser.c b/girepository/girparser.c
index 0b2366f..bf10e44 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -881,8 +881,8 @@ start_parameter (GMarkupParseContext *context,
   const gchar *name;
   const gchar *direction;
   const gchar *retval;
-  const gchar *dipper;
   const gchar *optional;
+  const gchar *caller_allocates;
   const gchar *allow_none;
   const gchar *transfer;
   const gchar *scope;
@@ -897,9 +897,9 @@ start_parameter (GMarkupParseContext *context,
   name = find_attribute ("name", attribute_names, attribute_values);
   direction = find_attribute ("direction", attribute_names, attribute_values);
   retval = find_attribute ("retval", attribute_names, attribute_values);
-  dipper = find_attribute ("dipper", attribute_names, attribute_values);
   optional = find_attribute ("optional", attribute_names, attribute_values);
   allow_none = find_attribute ("allow-none", attribute_names, attribute_values);
+  caller_allocates = find_attribute ("caller-allocates", attribute_names, attribute_values);
   transfer = find_attribute ("transfer-ownership", attribute_names, attribute_values);
   scope = find_attribute ("scope", attribute_names, attribute_values);
   closure = find_attribute ("closure", attribute_names, attribute_values);
@@ -919,16 +919,27 @@ start_parameter (GMarkupParseContext *context,
     {
       param->in = FALSE;
       param->out = TRUE;
+      if (caller_allocates == NULL)
+        {
+          g_set_error (error,
+		       G_MARKUP_ERROR,
+                       G_MARKUP_ERROR_INVALID_CONTENT,
+                       "caller-allocates attribute required on out parameters");
+          return FALSE;
+        }
+      param->caller_allocates = strcmp (caller_allocates, "1") == 0;
     }
   else if (direction && strcmp (direction, "inout") == 0)
     {
       param->in = TRUE;
       param->out = TRUE;
+      param->caller_allocates = FALSE;
     }
   else
     {
       param->in = TRUE;
       param->out = FALSE;
+      param->caller_allocates = FALSE;
     }
 
   if (retval && strcmp (retval, "1") == 0)
@@ -936,11 +947,6 @@ start_parameter (GMarkupParseContext *context,
   else
     param->retval = FALSE;
 
-  if (dipper && strcmp (dipper, "1") == 0)
-    param->dipper = TRUE;
-  else
-    param->dipper = FALSE;
-
   if (optional && strcmp (optional, "1") == 0)
     param->optional = TRUE;
   else
diff --git a/girepository/gtypelib.h b/girepository/gtypelib.h
index 617cb39..0524efa 100644
--- a/girepository/gtypelib.h
+++ b/girepository/gtypelib.h
@@ -349,7 +349,7 @@ typedef union
  * add another level of indirection to the parameter type. Ie if
  * the type is uint32 in an out parameter, the function actually
  * takes an uint32*.
- * @dipper: The parameter is a pointer to a struct or object that will
+ * @caller_allocates: The parameter is a pointer to a struct or object that will
  * receive an output of the function.
  * @allow_none: Only meaningful for types which are passed as pointers.
  * For an in parameter, indicates if it is ok to pass NULL in, for
@@ -388,7 +388,7 @@ typedef struct {
 
   guint          in                           : 1;
   guint          out                          : 1;
-  guint          dipper                       : 1;
+  guint          caller_allocates             : 1;
   guint          allow_none                   : 1;
   guint          optional                     : 1;
   guint          transfer_ownership           : 1;
@@ -397,7 +397,7 @@ typedef struct {
   guint          scope                        : 3;
   /* <private> */
   guint          reserved                     :21;
-  /* <public> */
+
   gint8        closure;
   gint8        destroy;
 
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index 93e4184..1fd82cc 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -587,13 +587,15 @@ class AnnotationApplier(object):
 
     def _parse_param_ret_common(self, parent, node, tag):
         options = getattr(tag, 'options', {})
-        node.direction = self._extract_direction(node, options)
+        (node.direction, node.caller_allocates) = \
+            self._extract_direction(node, options)
         container_type = self._extract_container_type(
             parent, node, options)
         if container_type is not None:
             node.type = container_type
         if node.direction is None:
             node.direction = self._guess_direction(node)
+            node.caller_allocates = False
         node.transfer = self._extract_transfer(parent, node, options)
         param_type = options.get(OPT_TYPE)
         if param_type:
@@ -608,16 +610,32 @@ class AnnotationApplier(object):
             node.doc = tag.comment
 
     def _extract_direction(self, node, options):
+        caller_allocates = False
         if (OPT_INOUT in options or
             OPT_INOUT_ALT in options):
             direction = PARAM_DIRECTION_INOUT
         elif OPT_OUT in options:
+            subtype = options[OPT_OUT]
+            if subtype is not None:
+                subtype = subtype.one()
             direction = PARAM_DIRECTION_OUT
+            if subtype in (None, ''):
+                if (node.type.name not in BASIC_GIR_TYPES) and node.type.ctype:
+                    caller_allocates = '**' not in node.type.ctype
+                else:
+                    caller_allocates = False
+            elif subtype == 'caller-allocates':
+                caller_allocates = True
+            elif subtype == 'callee-allocates':
+                caller_allocates = False
+            else:
+                raise InvalidAnnotationError(
+                    "out direction for %s is invalid (%r)" % (node, subtype))
         elif OPT_IN in options:
             direction = PARAM_DIRECTION_IN
         else:
             direction = node.direction
-        return direction
+        return (direction, caller_allocates)
 
     def _guess_array(self, node):
         ctype = node.type.ctype
@@ -885,6 +903,8 @@ class AnnotationApplier(object):
         elif isinstance(node, Parameter):
             if node.direction in [PARAM_DIRECTION_INOUT,
                                   PARAM_DIRECTION_OUT]:
+                if node.caller_allocates:
+                    return PARAM_TRANSFER_NONE
                 return PARAM_TRANSFER_FULL
             # This one is a hack for compatibility; the transfer
             # for string parameters really has no defined meaning.
diff --git a/giscanner/ast.py b/giscanner/ast.py
index bd16251..902a3f6 100644
--- a/giscanner/ast.py
+++ b/giscanner/ast.py
@@ -367,6 +367,7 @@ class Parameter(TypeContainer):
         else:
             self.direction = PARAM_DIRECTION_IN
 
+        self.caller_allocates = False
         self.allow_none = allow_none
         self.scope = scope
         self.closure_index = -1
diff --git a/giscanner/girwriter.py b/giscanner/girwriter.py
index e1a1f02..48791b1 100644
--- a/giscanner/girwriter.py
+++ b/giscanner/girwriter.py
@@ -207,6 +207,8 @@ and/or use gtk-doc annotations. ''')
             attrs.append(('name', parameter.name))
         if parameter.direction != 'in':
             attrs.append(('direction', parameter.direction))
+            attrs.append(('caller-allocates',
+                          '1' if parameter.caller_allocates else '0'))
         attrs.append(('transfer-ownership',
                      parameter.transfer))
         if parameter.allow_none:
diff --git a/tests/invoke/testfns-1.0.gir b/tests/invoke/testfns-1.0.gir
index baaca64..b077f49 100644
--- a/tests/invoke/testfns-1.0.gir
+++ b/tests/invoke/testfns-1.0.gir
@@ -23,7 +23,7 @@
         <parameter name="in" c:type="gint" direction="in" transfer-ownership="none">
           <type name="int" c:type="gint"/>
         </parameter>
-        <parameter name="out" c:type="gint" direction="out" transfer-ownership="none">
+        <parameter name="out" c:type="gint" direction="out" transfer-ownership="none" caller-allocates="0">
           <type name="int" c:type="gint"/>
         </parameter>
       </parameters>
@@ -56,10 +56,10 @@
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="blurb" direction="out" transfer-ownership="full">
+        <parameter name="blurb" direction="out" transfer-ownership="full" caller-allocates="0">
           <type name="utf8" c:type="gchar*"/>
         </parameter>
-        <parameter name="len" direction="out" transfer-ownership="none">
+        <parameter name="len" direction="out" transfer-ownership="none" caller-allocates="0">
           <type name="int" c:type="gint"/>
         </parameter>
       </parameters>
@@ -104,7 +104,7 @@
           <type name="none" c:type="void"/>
         </return-value>
         <parameters>
-          <parameter name="out" direction="out" transfer-ownership="full">
+          <parameter name="out" direction="out" transfer-ownership="full" caller-allocates="0">
             <type name="int" c:type="int*"/>
           </parameter>
         </parameters>
diff --git a/tests/scanner/annotation-1.0-expected.gir b/tests/scanner/annotation-1.0-expected.gir
index ab81ae1..035b32e 100644
--- a/tests/scanner/annotation-1.0-expected.gir
+++ b/tests/scanner/annotation-1.0-expected.gir
@@ -96,6 +96,7 @@ and/or use gtk-doc annotations.  -->
         <parameters>
           <parameter name="outarg"
                      direction="out"
+                     caller-allocates="0"
                      transfer-ownership="full"
                      doc="This is an argument test">
             <type name="int" c:type="int*"/>
@@ -134,6 +135,7 @@ and/or use gtk-doc annotations.  -->
         <parameters>
           <parameter name="inoutarg"
                      direction="inout"
+                     caller-allocates="0"
                      transfer-ownership="full"
                      doc="This is an argument test">
             <type name="int" c:type="int*"/>
@@ -149,6 +151,7 @@ and/or use gtk-doc annotations.  -->
         <parameters>
           <parameter name="inoutarg"
                      direction="inout"
+                     caller-allocates="0"
                      transfer-ownership="full"
                      doc="This is an argument test">
             <type name="int" c:type="int*"/>
@@ -164,6 +167,7 @@ and/or use gtk-doc annotations.  -->
         <parameters>
           <parameter name="inoutarg"
                      direction="inout"
+                     caller-allocates="0"
                      transfer-ownership="full"
                      allow-none="1"
                      doc="This is an argument test">
@@ -194,6 +198,7 @@ and/or use gtk-doc annotations.  -->
         <parameters>
           <parameter name="toown"
                      direction="out"
+                     caller-allocates="0"
                      transfer-ownership="full"
                      doc="a #GObject">
             <type name="GObject.Object" c:type="GObject**"/>
@@ -209,12 +214,14 @@ and/or use gtk-doc annotations.  -->
         <parameters>
           <parameter name="toown1"
                      direction="out"
+                     caller-allocates="0"
                      transfer-ownership="full"
                      doc="a #GObject">
             <type name="GObject.Object" c:type="GObject**"/>
           </parameter>
           <parameter name="toown2"
                      direction="out"
+                     caller-allocates="0"
                      transfer-ownership="none"
                      doc="a #GObject">
             <type name="GObject.Object" c:type="GObject**"/>
@@ -338,12 +345,14 @@ intentionally similar example to gtk_container_get_children">
         <parameters>
           <parameter name="argc"
                      direction="inout"
+                     caller-allocates="0"
                      transfer-ownership="full"
                      doc="Length of the argument vector">
             <type name="int" c:type="int*"/>
           </parameter>
           <parameter name="argv"
                      direction="inout"
+                     caller-allocates="0"
                      transfer-ownership="full"
                      doc="Argument vector">
             <array length="1" c:type="char***">
@@ -361,6 +370,7 @@ intentionally similar example to gtk_container_get_children">
         <parameters>
           <parameter name="str_out"
                      direction="out"
+                     caller-allocates="0"
                      transfer-ownership="full"
                      doc="string return value">
             <type name="utf8" c:type="char**"/>
@@ -581,12 +591,14 @@ detection, and fixing it via annotations.">
       <parameters>
         <parameter name="argc"
                    direction="inout"
+                   caller-allocates="0"
                    transfer-ownership="full"
                    doc="The number of args.">
           <type name="int" c:type="int*"/>
         </parameter>
         <parameter name="argv"
                    direction="inout"
+                   caller-allocates="0"
                    transfer-ownership="full"
                    doc="The arguments.">
           <array length="0" c:type="char***">
@@ -604,6 +616,7 @@ detection, and fixing it via annotations.">
       <parameters>
         <parameter name="length"
                    direction="out"
+                   caller-allocates="0"
                    transfer-ownership="full"
                    doc="Number of return values">
           <type name="int" c:type="int*"/>
@@ -650,7 +663,10 @@ detection, and fixing it via annotations.">
         <type name="none" c:type="void"/>
       </return-value>
       <parameters>
-        <parameter name="out" direction="inout" transfer-ownership="full">
+        <parameter name="out"
+                   direction="inout"
+                   caller-allocates="0"
+                   transfer-ownership="full">
           <array c:type="char***">
             <type name="utf8"/>
           </array>
diff --git a/tests/scanner/annotation-1.0-expected.tgir b/tests/scanner/annotation-1.0-expected.tgir
index 9e9370b..3b37cf2 100644
--- a/tests/scanner/annotation-1.0-expected.tgir
+++ b/tests/scanner/annotation-1.0-expected.tgir
@@ -72,7 +72,7 @@
           <type name="int"/>
         </return-value>
         <parameters>
-          <parameter name="outarg" transfer-ownership="full" direction="out">
+          <parameter name="outarg" transfer-ownership="full" direction="out" caller-allocates="0">
             <type name="int"/>
           </parameter>
         </parameters>
@@ -142,7 +142,7 @@
           <type name="int"/>
         </return-value>
         <parameters>
-          <parameter name="toown" transfer-ownership="full" direction="out">
+          <parameter name="toown" transfer-ownership="full" direction="out" caller-allocates="0">
             <type name="GObject.Object"/>
           </parameter>
         </parameters>
@@ -152,10 +152,10 @@
           <type name="int"/>
         </return-value>
         <parameters>
-          <parameter name="toown1" transfer-ownership="full" direction="out">
+          <parameter name="toown1" transfer-ownership="full" direction="out" caller-allocates="0">
             <type name="GObject.Object"/>
           </parameter>
-          <parameter name="toown2" transfer-ownership="none" direction="out">
+          <parameter name="toown2" transfer-ownership="none" direction="out" caller-allocates="0">
             <type name="GObject.Object"/>
           </parameter>
         </parameters>
@@ -266,7 +266,7 @@
           <type name="boolean"/>
         </return-value>
         <parameters>
-          <parameter name="str_out" transfer-ownership="full" direction="out">
+          <parameter name="str_out" transfer-ownership="full" direction="out" caller-allocates="0">
             <type name="utf8"/>
           </parameter>
         </parameters>
@@ -447,7 +447,7 @@
         </array>
       </return-value>
       <parameters>
-        <parameter name="length" transfer-ownership="full" direction="out">
+        <parameter name="length" transfer-ownership="full" direction="out" caller-allocates="0">
           <type name="int"/>
         </parameter>
       </parameters>
diff --git a/tests/scanner/drawable-1.0-expected.gir b/tests/scanner/drawable-1.0-expected.gir
index da63777..981abdb 100644
--- a/tests/scanner/drawable-1.0-expected.gir
+++ b/tests/scanner/drawable-1.0-expected.gir
@@ -36,10 +36,16 @@ and/or use gtk-doc annotations.  -->
           <type name="none" c:type="void"/>
         </return-value>
         <parameters>
-          <parameter name="x" direction="out" transfer-ownership="full">
+          <parameter name="x"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="full">
             <type name="int" c:type="int*"/>
           </parameter>
-          <parameter name="y" direction="out" transfer-ownership="full">
+          <parameter name="y"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="full">
             <type name="int" c:type="int*"/>
           </parameter>
         </parameters>
@@ -49,10 +55,16 @@ and/or use gtk-doc annotations.  -->
           <type name="none" c:type="void"/>
         </return-value>
         <parameters>
-          <parameter name="width" direction="out" transfer-ownership="full">
+          <parameter name="width"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="full">
             <type name="uint" c:type="guint*"/>
           </parameter>
-          <parameter name="height" direction="out" transfer-ownership="full">
+          <parameter name="height"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="full">
             <type name="uint" c:type="guint*"/>
           </parameter>
         </parameters>
diff --git a/tests/scanner/drawable-1.0-expected.tgir b/tests/scanner/drawable-1.0-expected.tgir
index 705235e..996e9cd 100644
--- a/tests/scanner/drawable-1.0-expected.tgir
+++ b/tests/scanner/drawable-1.0-expected.tgir
@@ -26,10 +26,10 @@
           <type name="none"/>
         </return-value>
         <parameters>
-          <parameter name="x" transfer-ownership="full" direction="out">
+          <parameter name="x" transfer-ownership="full" direction="out" caller-allocates="0">
             <type name="int"/>
           </parameter>
-          <parameter name="y" transfer-ownership="full" direction="out">
+          <parameter name="y" transfer-ownership="full" direction="out" caller-allocates="0">
             <type name="int"/>
           </parameter>
         </parameters>
@@ -39,10 +39,10 @@
           <type name="none"/>
         </return-value>
         <parameters>
-          <parameter name="width" transfer-ownership="full" direction="out">
+          <parameter name="width" transfer-ownership="full" direction="out" caller-allocates="0">
             <type name="uint"/>
           </parameter>
-          <parameter name="height" transfer-ownership="full" direction="out">
+          <parameter name="height" transfer-ownership="full" direction="out" caller-allocates="0">
             <type name="uint"/>
           </parameter>
         </parameters>
diff --git a/tools/generate.c b/tools/generate.c
index b813b12..42772da 100644
--- a/tools/generate.c
+++ b/tools/generate.c
@@ -479,7 +479,8 @@ write_callable_info (const gchar    *namespace,
 	case GI_DIRECTION_IN:
 	  break;
 	case GI_DIRECTION_OUT:
-	  xml_printf (file, " direction=\"out\"");
+	  xml_printf (file, " direction=\"out\" caller-allocates=\"%s\"",
+	              g_arg_info_is_caller_allocates (arg) ? "1" : "0");
 	  break;
 	case GI_DIRECTION_INOUT:
 	  xml_printf (file, " direction=\"inout\"");
@@ -489,9 +490,6 @@ write_callable_info (const gchar    *namespace,
       if (g_arg_info_may_be_null (arg))
 	xml_printf (file, " allow-none=\"1\"");
 
-      if (g_arg_info_is_dipper (arg))
-	xml_printf (file, " dipper=\"1\"");
-
       if (g_arg_info_is_return_value (arg))
 	xml_printf (file, " retval=\"1\"");
 



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