diff options
author | Anthony PERARD <anthony.perard@citrix.com> | 2012-10-05 14:34:30 +0100 |
---|---|---|
committer | Anthony PERARD <anthony.perard@citrix.com> | 2012-10-05 14:34:30 +0100 |
commit | 5fe37ba9c6b6658ed7980f81f8374acd6e2f3bbd (patch) | |
tree | 74ef7377424cc78bfe25429e3a9c7b047a5cd3b7 /tools/libxl/flexarray.h | |
parent | 3c8ec17b26e686a6601e1a678c090f44464ad514 (diff) | |
download | xen-5fe37ba9c6b6658ed7980f81f8374acd6e2f3bbd.tar.gz xen-5fe37ba9c6b6658ed7980f81f8374acd6e2f3bbd.tar.bz2 xen-5fe37ba9c6b6658ed7980f81f8374acd6e2f3bbd.zip |
libxl: Have flexarray using the GC
This patch makes the flexarray function libxl__gc aware.
It also updates every function that use a flexarray to pass the gc and removes
every memory allocation check and free.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxl/flexarray.h')
-rw-r--r-- | tools/libxl/flexarray.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/libxl/flexarray.h b/tools/libxl/flexarray.h index ae17f3b14e..aade417906 100644 --- a/tools/libxl/flexarray.h +++ b/tools/libxl/flexarray.h @@ -16,16 +16,19 @@ #ifndef FLEXARRAY_H #define FLEXARRAY_H +struct libxl__gc; + typedef struct flexarray { int size; int autogrow; unsigned int count; void **data; /* array of pointer */ + struct libxl__gc *gc; } flexarray_t; -_hidden flexarray_t *flexarray_make(int size, int autogrow); +_hidden flexarray_t *flexarray_make(struct libxl__gc *gc, int size, int autogrow); _hidden void flexarray_free(flexarray_t *array); -_hidden int flexarray_grow(flexarray_t *array, int extents); +_hidden void flexarray_grow(flexarray_t *array, int extents); _hidden int flexarray_set(flexarray_t *array, unsigned int index, void *ptr); _hidden int flexarray_append(flexarray_t *array, void *ptr); _hidden int flexarray_append_pair(flexarray_t *array, void *ptr1, void *ptr2); |