WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 08 of 16] libxl: do not generate a destructor for dat

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 08 of 16] libxl: do not generate a destructor for data types which do not require one
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Wed, 18 Aug 2010 16:44:31 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Wed, 18 Aug 2010 08:54:08 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1282146263@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1282143677 -3600
# Node ID 6315b60118071a50e53f1ce3d959528538ed665f
# Parent  a02fd486972239cb17683f69dc8a506df21ef0d3
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.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r a02fd4869722 -r 6315b6011807 tools/libxl/gentypes.py
--- a/tools/libxl/gentypes.py   Wed Aug 18 16:01:17 2010 +0100
+++ b/tools/libxl/gentypes.py   Wed Aug 18 16:01:17 2010 +0100
@@ -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))
diff -r a02fd4869722 -r 6315b6011807 tools/libxl/libxl.idl
--- a/tools/libxl/libxl.idl     Wed Aug 18 16:01:17 2010 +0100
+++ b/tools/libxl/libxl.idl     Wed Aug 18 16:01:17 2010 +0100
@@ -40,16 +40,16 @@ SHUTDOWN_* constant."""),
     ("cpu_time",    uint64),
     ("vcpu_max_id", uint32),
     ("vcpu_online", uint32),
-    ])
+    ], destructor_fn=None)
 
 libxl_poolinfo = Struct("poolinfo", [
     ("poolid", uint32)
-    ])
+    ], destructor_fn=None)
 
 libxl_vminfo = Struct("vminfo", [
     ("uuid", libxl_uuid),
     ("domid", domid),
-    ])
+    ], destructor_fn=None)
 
 libxl_version_info = Struct("version_info", [
     ("xen_version_major", integer),
@@ -132,7 +132,7 @@ libxl_domain_build_state = Struct("domai
     ("store_mfn",    unsigned_long),
     ("console_port", uint32),
     ("console_mfn",  unsigned_long),
-    ])
+    ], destructor_fn=None)
 
 libxl_device_model_info = Struct("device_model_info",[
     ("domid",            integer),
@@ -308,12 +308,12 @@ libxl_physinfo = Struct("physinfo", [
     ("nr_nodes", uint32),
     ("hw_cap", libxl_hwcap),
     ("phys_cap", uint32),
-    ])
+    ], destructor_fn=None)
 
 libxl_sched_credit = Struct("sched_credit", [
     ("weight", integer),
     ("cap", integer),
-    ])
+    ], destructor_fn=None)
 
 libxl_net2info = Struct("net2info", [
     ("backend", string),

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>