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 15 of 26] libxl: do not generate a destructor for dat

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 15 of 26] libxl: do not generate a destructor for data types which do not require one
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Mon, 16 Aug 2010 15:33:39 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Mon, 16 Aug 2010 07:44:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1281969204@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 1281969065 -3600
# Node ID 4c0e7313a88fc4219f37cf48177a1c807ca4d22b
# Parent  7d3021e9dcfbaaa18481c93b854733726c4d6267
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 7d3021e9dcfb -r 4c0e7313a88f tools/libxl/gentypes.py
--- a/tools/libxl/gentypes.py   Mon Aug 16 15:31:05 2010 +0100
+++ b/tools/libxl/gentypes.py   Mon Aug 16 15:31:05 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 7d3021e9dcfb -r 4c0e7313a88f tools/libxl/libxltypes.idl
--- a/tools/libxl/libxltypes.idl        Mon Aug 16 15:31:05 2010 +0100
+++ b/tools/libxl/libxltypes.idl        Mon Aug 16 15:31:05 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>