summaryrefslogtreecommitdiff
path: root/python_modules/ptypes.py
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-07-07 20:40:06 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2012-03-20 15:25:47 +0100
commit4b6605fc4214de1ec31148f4a7d34ac110bc9504 (patch)
treec8a078472c731948ef5ec2dfa1897bbbff263756 /python_modules/ptypes.py
parent601d1be843cb58c169af34a8094d69281826e867 (diff)
codegen: support @chunk on non-pointer arrays
This is similar to @as_ptr, but generates a single chunk of data.
Diffstat (limited to 'python_modules/ptypes.py')
-rw-r--r--python_modules/ptypes.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py
index f02437a..68cf3df 100644
--- a/python_modules/ptypes.py
+++ b/python_modules/ptypes.py
@@ -60,7 +60,7 @@ class FixedSize:
# only to attributes that affect pointer or array attributes, as these
# are member local types, unlike e.g. a Struct that may be used by
# other members
-propagated_attributes=["ptr_array", "c_ptr", "nonnull"]
+propagated_attributes=["ptr_array", "c_ptr", "nonnull", "chunk"]
class Type:
def __init__(self):
@@ -428,7 +428,7 @@ class ArrayType(Type):
return self.has_attr("ptr_array")
def contains_extra_size(self):
- return self.element_type.contains_extra_size()
+ return self.element_type.contains_extra_size() or self.has_attr("chunk")
def sizeof(self):
return "%s * %s" % (self.element_type.sizeof(), self.size)