aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/gentypes.py
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2010-08-19 15:24:41 +0100
committerIan Campbell <ian.campbell@citrix.com>2010-08-19 15:24:41 +0100
commit60ce81bc56b4b8a997a7d8791390d3da1a389a71 (patch)
tree39181582f1570216a255678125f64b651c536489 /tools/libxl/gentypes.py
parent252af5a1a0f8f94b440795c298178ca12be8112e (diff)
downloadxen-60ce81bc56b4b8a997a7d8791390d3da1a389a71.tar.gz
xen-60ce81bc56b4b8a997a7d8791390d3da1a389a71.tar.bz2
xen-60ce81bc56b4b8a997a7d8791390d3da1a389a71.zip
libxl: do not generate a destructor for data types which do not require one
libxl_dominfo, libxl_poolinfo, libxl_vminfo, libxl_domain_build_state, libxl_physinfo and libxl_sched_credit contain no members which require destruction so omit the auto generated destructor. As an exception continue to generate destructors for libxl_device_* and libxl_{devtype}* even if they have no interesting members so that all device types can be treated the same without special knowledge about the type contents being required. [PATCH 08 of 16 of libxl: autogenerate type definitions and destructor functions] Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/gentypes.py')
-rw-r--r--tools/libxl/gentypes.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/libxl/gentypes.py b/tools/libxl/gentypes.py
index e4762d3767..175fae3e3c 100644
--- a/tools/libxl/gentypes.py
+++ b/tools/libxl/gentypes.py
@@ -150,7 +150,7 @@ if __name__ == '__main__':
""" % " ".join(sys.argv))
- for ty in [t for t in types if t.autogenerate_destructor]:
+ for ty in [t for t in types if t.destructor_fn is not None and t.autogenerate_destructor]:
f.write("void %s(%s *p)\n" % (ty.destructor_fn, ty.typename))
f.write("{\n")
f.write(libxl_C_type_destroy(ty, "p", True))