summaryrefslogtreecommitdiff
path: root/giscanner/ast.py
diff options
context:
space:
mode:
authorGiovanni Campagna <gcampagna@src.gnome.org>2011-07-02 15:31:38 +0200
committerGiovanni Campagna <gcampagna@src.gnome.org>2011-08-18 15:15:04 +0200
commit8a4e168dec871fca394f1bc24f80f9a6abb8ceec (patch)
tree58e1a594ef66fb78bf76814aabbfe8dd0cafd626 /giscanner/ast.py
parente9b0c8013dd15d643e46dd6e763585d5fe1b5b45 (diff)
downloadgobject-introspection-8a4e168dec871fca394f1bc24f80f9a6abb8ceec.tar.gz
Forbid GPtrArrays holding non-pointer types
It should be safe for bindings to assume that GPtrArrays hold only pointers (or values as big as it), so there is no need to go through hoops for converting smaller integers when marshalling. Libraries that need arrays of integers should use GArray. https://bugzilla.gnome.org/show_bug.cgi?id=652753
Diffstat (limited to 'giscanner/ast.py')
-rw-r--r--giscanner/ast.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/giscanner/ast.py b/giscanner/ast.py
index 373daa9f..d2975afc 100644
--- a/giscanner/ast.py
+++ b/giscanner/ast.py
@@ -222,6 +222,10 @@ GIR_TYPES = [TYPE_NONE, TYPE_ANY]
GIR_TYPES.extend(BASIC_GIR_TYPES)
GIR_TYPES.extend([TYPE_STRING, TYPE_FILENAME, TYPE_VALIST])
+# These are the only basic types that are guaranteed to
+# be as big as a pointer (and thus are allowed in GPtrArray)
+POINTER_TYPES = [TYPE_ANY, TYPE_INTPTR, TYPE_UINTPTR]
+
INTROSPECTABLE_BASIC = list(GIR_TYPES)
for v in [TYPE_NONE, TYPE_ANY,
TYPE_LONG_LONG, TYPE_LONG_ULONG,