[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Make the string->string map and int->float map allocation functions set the



# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1170356417 0
# Node ID a357bed2daf8096bb5c682d454a2b3af652fc73f
# Parent  23bf61e72279682f46342d8c01977bed63ceb5be
Make the string->string map and int->float map allocation functions set the
map size on allocation.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/libxen/src/xen_int_float_map.c     |    6 ++++--
 tools/libxen/src/xen_string_string_map.c |    6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff -r 23bf61e72279 -r a357bed2daf8 tools/libxen/src/xen_int_float_map.c
--- a/tools/libxen/src/xen_int_float_map.c      Thu Feb 01 18:45:50 2007 +0000
+++ b/tools/libxen/src/xen_int_float_map.c      Thu Feb 01 19:00:17 2007 +0000
@@ -25,8 +25,10 @@ xen_int_float_map *
 xen_int_float_map *
 xen_int_float_map_alloc(size_t size)
 {
-    return calloc(1, sizeof(xen_int_float_map) +
-                  size * sizeof(struct xen_int_float_map_contents));
+    xen_int_float_map *result = calloc(1, sizeof(xen_int_float_map) +
+                                       size * sizeof(struct 
xen_int_float_map_contents));
+    result->size = size;
+    return result;
 }
 
 
diff -r 23bf61e72279 -r a357bed2daf8 tools/libxen/src/xen_string_string_map.c
--- a/tools/libxen/src/xen_string_string_map.c  Thu Feb 01 18:45:50 2007 +0000
+++ b/tools/libxen/src/xen_string_string_map.c  Thu Feb 01 19:00:17 2007 +0000
@@ -25,8 +25,10 @@ xen_string_string_map *
 xen_string_string_map *
 xen_string_string_map_alloc(size_t size)
 {
-    return calloc(1, sizeof(xen_string_string_map) +
-                  size * sizeof(struct xen_string_string_map_contents));
+    xen_string_string_map *result = calloc(1, sizeof(xen_string_string_map) +
+                                           size * sizeof(struct 
xen_string_string_map_contents));
+    result->size = size;
+    return result;
 }
 
 

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.