|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] libxl: Move gc_is_real to libxl_internal.h.
# HG changeset patch
# User Anthony PERARD <anthony.perard@xxxxxxxxxx>
# Date 1349444069 -3600
# Node ID 2513dc3a68f617c3246bbd3da3c9bd5920d5ca21
# Parent 0807d1f7773d9ea5825485d7069381d48192b434
libxl: Move gc_is_real to libxl_internal.h.
Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
diff -r 0807d1f7773d -r 2513dc3a68f6 tools/libxl/libxl_internal.c
--- a/tools/libxl/libxl_internal.c Fri Oct 05 14:34:28 2012 +0100
+++ b/tools/libxl/libxl_internal.c Fri Oct 05 14:34:29 2012 +0100
@@ -30,16 +30,11 @@ void libxl__alloc_failed(libxl_ctx *ctx,
#undef L
}
-static int gc_is_real(const libxl__gc *gc)
-{
- return gc->alloc_maxsize >= 0;
-}
-
void libxl__ptr_add(libxl__gc *gc, void *ptr)
{
int i;
- if (!gc_is_real(gc))
+ if (!libxl__gc_is_real(gc))
return;
if (!ptr)
@@ -71,7 +66,7 @@ void libxl__free_all(libxl__gc *gc)
void *ptr;
int i;
- assert(gc_is_real(gc));
+ assert(libxl__gc_is_real(gc));
for (i = 0; i < gc->alloc_maxsize; i++) {
ptr = gc->alloc_ptrs[i];
@@ -111,7 +106,7 @@ void *libxl__realloc(libxl__gc *gc, void
if (ptr == NULL) {
libxl__ptr_add(gc, new_ptr);
- } else if (new_ptr != ptr && gc_is_real(gc)) {
+ } else if (new_ptr != ptr && libxl__gc_is_real(gc)) {
for (i = 0; i < gc->alloc_maxsize; i++) {
if (gc->alloc_ptrs[i] == ptr) {
gc->alloc_ptrs[i] = new_ptr;
diff -r 0807d1f7773d -r 2513dc3a68f6 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h Fri Oct 05 14:34:28 2012 +0100
+++ b/tools/libxl/libxl_internal.h Fri Oct 05 14:34:29 2012 +0100
@@ -446,6 +446,11 @@ static inline libxl_ctx *libxl__gc_owner
return gc->owner;
}
+static inline int libxl__gc_is_real(const libxl__gc *gc)
+{
+ return gc->alloc_maxsize >= 0;
+}
+
/*
* Memory allocation tracking/helpers
*
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |