xen/13786_xenapi.patch

43 lines
1.7 KiB
Diff
Raw Normal View History

# HG changeset patch
# User Ewan Mellor <ewan@xensource.com>
# 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@xensource.com>
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;
}