[Spice-devel] [spice-protocol PATCH 03/46] qxl_mem.h: split from qxl.h

Alon Levy alevy at redhat.com
Tue Apr 10 04:49:59 PDT 2012


---
 src/qxl.h         |   14 ++------------
 src/qxl_driver.c  |    1 +
 src/qxl_image.c   |    1 +
 src/qxl_mem.c     |    1 +
 src/qxl_mem.h     |   21 +++++++++++++++++++++
 src/qxl_surface.c |    1 +
 6 files changed, 27 insertions(+), 12 deletions(-)
 create mode 100644 src/qxl_mem.h

diff --git a/src/qxl.h b/src/qxl.h
index 85256fa..f20a26c 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -375,18 +375,8 @@ void		  qxl_drop_image_cache (qxl_screen_t	       *qxl);
 /*
  * Malloc
  */
-int		  qxl_handle_oom (qxl_screen_t *qxl);
-struct qxl_mem *  qxl_mem_create       (void                   *base,
-					unsigned long           n_bytes);
-void              qxl_mem_dump_stats   (struct qxl_mem         *mem,
-					const char             *header);
-void *            qxl_alloc            (struct qxl_mem         *mem,
-					unsigned long           n_bytes);
-void              qxl_free             (struct qxl_mem         *mem,
-					void                   *d);
-void              qxl_mem_free_all     (struct qxl_mem         *mem);
-void *            qxl_allocnf          (qxl_screen_t           *qxl,
-					unsigned long           size);
+void *             qxl_allocnf         (qxl_screen_t *qxl,
+					unsigned long        size);
 int		   qxl_garbage_collect (qxl_screen_t *qxl);
 
 /*
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 88d01e4..99c5c6f 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -41,6 +41,7 @@
 #include <stdlib.h>
 #include "qxl.h"
 #include "qxl_ring.h"
+#include "qxl_mem.h"
 #include "assert.h"
 #include "qxl_option_helpers.h"
 
diff --git a/src/qxl_image.c b/src/qxl_image.c
index 2de10dc..3931ec7 100644
--- a/src/qxl_image.c
+++ b/src/qxl_image.c
@@ -33,6 +33,7 @@
 #include <assert.h>
 #include <stdlib.h>
 #include "qxl.h"
+#include "qxl_mem.h"
 #include "murmurhash3.h"
 
 typedef struct image_info_t image_info_t;
diff --git a/src/qxl_mem.c b/src/qxl_mem.c
index 467075c..7ae859c 100644
--- a/src/qxl_mem.c
+++ b/src/qxl_mem.c
@@ -26,6 +26,7 @@
 #endif
 
 #include "qxl.h"
+#include "qxl_mem.h"
 #include "mspace.h"
 
 struct qxl_mem
diff --git a/src/qxl_mem.h b/src/qxl_mem.h
new file mode 100644
index 0000000..7645373
--- /dev/null
+++ b/src/qxl_mem.h
@@ -0,0 +1,21 @@
+/* vim: set ts=8 : */
+#ifndef QXL_MEM_H
+#define QXL_MEM_H
+
+#include "qxl.h"
+
+/*
+ * Malloc
+ */
+struct qxl_mem *qxl_mem_create       (void                   *base,
+				      unsigned long           n_bytes);
+void            qxl_mem_dump_stats   (struct qxl_mem         *mem,
+				      const char             *header);
+void           *qxl_alloc            (struct qxl_mem         *mem,
+				      unsigned long           n_bytes);
+void            qxl_free             (struct qxl_mem         *mem,
+				      void                   *d);
+void            qxl_mem_free_all     (struct qxl_mem         *mem);
+int		qxl_handle_oom       (qxl_screen_t    *qxl);
+
+#endif // QXL_MEM_H
diff --git a/src/qxl_surface.c b/src/qxl_surface.c
index 88e38c7..af8d67f 100644
--- a/src/qxl_surface.c
+++ b/src/qxl_surface.c
@@ -50,6 +50,7 @@
 
 #include "qxl.h"
 #include "qxl_ring.h"
+#include "qxl_mem.h"
 
 typedef struct evacuated_surface_t evacuated_surface_t;
 
-- 
1.7.9.3



More information about the Spice-devel mailing list